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

:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-purple: #8b5cf6;
    --accent-indigo: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --accent-green: #10b981;
    --transition-speed: 0.3s;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Noto Sans KR', 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Background Blobs */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: floatBlob 12s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-purple) 0%, rgba(0,0,0,0) 70%);
}

.blob-2 {
    bottom: -15%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-indigo) 0%, rgba(0,0,0,0) 70%);
    animation-delay: -4s;
}

.blob-3 {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, rgba(0,0,0,0) 60%);
    animation: pulseBlob 8s infinite alternate ease-in-out;
}

@keyframes floatBlob {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(40px) scale(1.1); }
}

@keyframes pulseBlob {
    0% { opacity: 0.2; transform: translate(-50%, -50%) scale(0.9); }
    100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.1); }
}

/* Container & Card */
.survey-container {
    width: 100%;
    max-width: 780px;
    z-index: 10;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

.survey-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

@media (max-width: 640px) {
    .survey-card {
        padding: 2rem 1.5rem;
    }
}

/* Header */
.survey-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.survey-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 30%, var(--accent-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.survey-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
}

.survey-header .accent-bar {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-indigo));
    border-radius: 2px;
    margin: 1.5rem auto 0 auto;
}

/* Form Styles */
.question-section {
    margin-bottom: 3rem;
    position: relative;
}

.question-section:last-of-type {
    margin-bottom: 2rem;
}

.question-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.question-num {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.question-subtitle {
    font-size: 0.85rem;
    color: var(--accent-indigo);
    font-weight: 500;
    margin-top: -0.75rem;
    margin-left: 2.2rem;
    margin-bottom: 1rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-left: 2.2rem;
}

@media (max-width: 640px) {
    .options-list {
        margin-left: 0;
    }
}

/* Custom Checkbox and Radio */
.option-label {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.option-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom Indicator Box */
.custom-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.option-label input[type="radio"] ~ .custom-indicator {
    border-radius: 50%;
}

.option-label input[type="checkbox"] ~ .custom-indicator {
    border-radius: 5px;
}

.custom-indicator::after {
    content: '';
    display: none;
}

.option-label input[type="radio"] ~ .custom-indicator::after {
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
}

.option-label input[type="checkbox"] ~ .custom-indicator::after {
    width: 10px;
    height: 6px;
    border: solid #fff;
    border-width: 0 0 2px 2px;
    transform: rotate(-45deg) translate(1px, -1px);
}

/* Checked States */
.option-label input:checked ~ .custom-indicator {
    background-color: var(--accent-indigo);
    border-color: var(--accent-indigo);
    box-shadow: 0 0 8px var(--accent-indigo);
}

.option-label input:checked ~ .custom-indicator::after {
    display: block;
}

.option-label.active-checked {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--accent-indigo);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

/* Custom Text Input for 기타 */
.custom-text-input {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-speed) ease;
    outline: none;
    display: none;
    animation: fadeInSlide 0.3s ease forwards;
}

.custom-text-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
    background: rgba(0, 0, 0, 0.3);
}

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

/* Textarea styling */
.text-area-container {
    margin-left: 2.2rem;
}

@media (max-width: 640px) {
    .text-area-container {
        margin-left: 0;
    }
}

.textarea-custom {
    width: 100%;
    height: 120px;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: all var(--transition-speed) ease;
}

.textarea-custom:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent-indigo);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

/* Q7 Recommendation Score Grid */
.score-outer-container {
    margin-left: 2.2rem;
}

@media (max-width: 640px) {
    .score-outer-container {
        margin-left: 0;
    }
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .score-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}
@media (max-width: 480px) {
    .score-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.score-btn-label {
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.score-btn-label input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.score-btn-label:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-indigo);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.score-btn-label input:checked + span {
    color: #fff;
}

.score-btn-label.score-checked {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    border-color: transparent;
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.5);
    color: #fff;
}

.score-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0 0.5rem;
    margin-top: 0.5rem;
}

/* Submit Button Container */
.submit-container {
    text-align: center;
    margin-top: 4rem;
}

.btn-submit {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-indigo) 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1.1rem 3.5rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    width: 100%;
    max-width: 320px;
}

.btn-submit:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.5);
}

.btn-submit:active {
    transform: translateY(-1px) scale(0.99);
}

.btn-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease-out;
    pointer-events: none;
    border-radius: 50%;
}

.btn-submit:focus::after {
    transform: translate(-50%, -50%) scale(1.2);
}

/* Footer info */
.survey-footer-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2rem;
}

/* Thank You page design */
.thankyou-card {
    text-align: center;
    padding: 4rem 3rem;
}

.thankyou-icon {
    font-size: 4rem;
    color: var(--accent-green);
    margin-bottom: 2rem;
    animation: bounceScale 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite alternate;
}

@keyframes bounceScale {
    0% { transform: scale(0.9); }
    100% { transform: scale(1.1); }
}

.thankyou-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 50%, var(--accent-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.thankyou-card p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.btn-secondary {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.9rem 2rem;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-indigo);
    transform: translateY(-2px);
}

/* Admin Styles */
.admin-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.admin-title-group h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--accent-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-nav-actions {
    display: flex;
    gap: 1rem;
}

.btn-action {
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-action.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-action.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-action.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-action.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-action.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-action.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #fff, var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 0.5rem;
}

/* Charts Panel Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.chart-card {
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
}

.chart-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
    color: #fff;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Simple Custom CSS Bar Chart for fallback or list style */
.custom-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.chart-bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.bar-label {
    color: var(--text-primary);
    font-weight: 500;
}

.bar-value {
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
}

.bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-indigo));
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Data Table Card */
.table-card {
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    overflow: hidden;
}

.table-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #fff;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.data-table td {
    color: var(--text-primary);
}

.data-table .cell-date {
    font-family: 'Outfit', sans-serif;
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table .cell-score {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-align: center;
}

.score-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.score-badge.high {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.score-badge.mid {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.score-badge.low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.comment-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    max-width: 300px;
    word-break: break-all;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-indigo);
}

.page-link.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

/* Admin Login Card */
.login-card {
    max-width: 420px;
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h2 {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #fff, var(--accent-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-custom {
    width: 100%;
    padding: 0.85rem 1.1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-custom:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
    background: rgba(0, 0, 0, 0.35);
}

.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
