/**
 * WebSocket URL 설정 모달 스타일
 */

/* 모달 오버레이 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 모달 컨테이너 */
.modal-content {
    background-color: #1e1e1e;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease;
}

.modal-content.modal-medium {
    max-width: 600px;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 모달 헤더 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #333;
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: #4a9eff;
}

.modal-close {
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #fff;
}

/* 모달 바디 */
.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

/* 설정 섹션 */
.settings-section {
    margin-bottom: 24px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #ddd;
}

.settings-label i {
    margin-right: 6px;
    color: #4a9eff;
}

/* 입력 필드 */
.settings-input {
    width: 100%;
    padding: 12px 16px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.settings-input:focus {
    outline: none;
    border-color: #4a9eff;
    background-color: #333;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.settings-input::placeholder {
    color: #666;
}

/* WebSocket URL 입력 그룹 */
.websocket-url-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.websocket-url-input-group .settings-input {
    flex: 1;
}

.btn-test-connection {
    padding: 12px 20px;
    background: linear-gradient(135deg, #4a9eff 0%, #357abd 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-test-connection:hover {
    background: linear-gradient(135deg, #5aa9ff 0%, #4589cd 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.btn-test-connection:active {
    transform: translateY(0);
}

.btn-test-connection:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 힌트 텍스트 */
.form-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #888;
    line-height: 1.4;
}

.form-hint i {
    margin-right: 4px;
    color: #4a9eff;
}

/* 연결 상태 */
.connection-status {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #333;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.status-item:not(:last-child) {
    border-bottom: 1px solid #333;
}

.status-label {
    font-size: 0.9rem;
    color: #aaa;
}

.status-value {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-value i {
    font-size: 0.7rem;
}

.text-success {
    color: #4ade80 !important;
}

.text-danger {
    color: #ef4444 !important;
}

.text-warning {
    color: #fbbf24 !important;
}

.text-muted {
    color: #666 !important;
}

/* 예시 목록 */
.websocket-url-examples {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #333;
}

.example-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.example-list li {
    padding: 12px;
    background-color: #1e1e1e;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #ddd;
}

.example-list li:hover {
    background-color: #333;
    transform: translateX(4px);
}

.example-list li i {
    color: #4a9eff;
    font-size: 1.1rem;
}

.example-list li code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #4ade80;
    background-color: rgba(74, 222, 128, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 모달 푸터 */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: #1a1a1a;
    border-radius: 0 0 12px 12px;
}

.btn-cancel,
.btn-confirm {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-cancel {
    background-color: #333;
    color: #ddd;
}

.btn-cancel:hover {
    background-color: #444;
}

.btn-confirm {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #fff;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #5ae890 0%, #2dd56e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.btn-confirm:active {
    transform: translateY(0);
}

/* 스크롤바 스타일 */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 반응형 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .websocket-url-input-group {
        flex-direction: column;
    }

    .btn-test-connection {
        width: 100%;
        justify-content: center;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-confirm {
        width: 100%;
        justify-content: center;
    }
}
