/* MDS-UPDRS Survey Stylesheet */
/* Modern Medical Assessment Design */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=Pretendard:wght@400;500;600;700&display=swap');

:root {
    --primary: #1a5f7a;
    --primary-dark: #134b5f;
    --primary-light: #e8f4f8;
    --secondary: #57c5b6;
    --accent: #159895;
    --warning: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--white);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: var(--white);
    color: var(--gray-800);
    padding: 20px 0 30px 0;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header img {
    display: block;
    margin: 0 auto 16px auto;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.5px;
    color: var(--gray-800);
}

.header .subtitle {
    font-size: 0.95rem;
    color: var(--gray-600);
    text-align: center;
    margin-top: 8px;
    font-weight: 300;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    border-bottom: 2px solid var(--gray-100);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    background: var(--gray-50);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: var(--white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: var(--white);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.1rem;
}

/* Survey Question Card */
.question-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.question-card:hover {
    box-shadow: var(--shadow-lg);
}

.question-card.answered {
    border-left-color: var(--success);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.05), transparent);
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 12px;
}

.question-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.question-description {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 16px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    line-height: 1.7;
}

/* Radio Options */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    position: relative;
}

.option-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option-label {
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-input:checked + .option-label {
    background: var(--primary-light);
    border-color: var(--primary);
}

.option-input:focus + .option-label {
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.15);
}

.option-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: var(--primary);
    color: var(--white);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 12px;
}

.option-input:checked + .option-label .option-score {
    background: var(--success);
}

.option-text {
    flex: 1;
}

.option-text strong {
    display: block;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.option-text span {
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* Progress Bar */
.progress-container {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    position: sticky;
    top: 10px;
    z-index: 100;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.progress-label {
    font-weight: 500;
    color: var(--gray-700);
}

.progress-value {
    color: var(--primary);
    font-weight: 600;
}

.progress-bar {
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 5px;
    transition: width 0.4s ease;
}

/* Navigation */
.nav-buttons {
    display: flex;
    gap: 16px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-100);
}

.nav-buttons .btn {
    flex: 1;
}

/* Part Indicator */
.part-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.part-dot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--gray-500);
    transition: all 0.3s ease;
}

.part-dot.active {
    background: var(--primary);
    color: var(--white);
}

.part-dot.completed {
    background: var(--success);
    color: var(--white);
}

/* Admin Styles */
.admin-header {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
    color: var(--white);
    padding: 20px 0;
    margin-bottom: 30px;
}

.admin-header .container-wide {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.admin-nav a {
    color: var(--white);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Table */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: var(--gray-50);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Search Box */
.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Login Form */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h2 {
    color: var(--primary);
    font-size: 1.5rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Result Page */
.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.result-item {
    background: var(--gray-50);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}

.result-item.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.result-score {
    font-size: 2rem;
    font-weight: 700;
}

.result-label {
    font-size: 0.85rem;
    margin-top: 4px;
    opacity: 0.8;
}

/* Intro Page */
.intro-section {
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.intro-section h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.intro-section ul {
    list-style: none;
    padding: 0;
}

.intro-section li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.intro-section li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .question-card {
        padding: 18px;
    }
    
    .option-label {
        padding: 12px;
    }
    
    .nav-buttons {
        flex-direction: column;
    }
    
    .part-indicator {
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    th, td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* Card Slider (One-at-a-time question view) */
.card-slider {
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.card-slider .question-card {
    display: none;
    margin-bottom: 0;
    animation: slideIn 0.3s ease;
}

.card-slider .question-card.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInReverse {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card-slider .question-card.slide-reverse {
    animation: slideInReverse 0.3s ease;
}

/* Question counter in slider mode */
.question-counter {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 16px;
    font-weight: 500;
}

.question-counter .current {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Slider navigation buttons */
.slider-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.slider-nav .btn {
    flex: 1;
    padding: 14px 20px;
}

.slider-nav .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--gray-800);
    color: var(--white);
    font-size: 0.8rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Action Buttons in Table */
.action-btns {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    font-size: 1rem;
}

/* User Detail Page */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.detail-sidebar {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
}

.detail-main {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.user-info-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.user-info-item:last-child {
    border-bottom: none;
}

.user-info-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-info-value {
    font-size: 1rem;
    color: var(--gray-800);
    font-weight: 500;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
