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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.2);
    --secondary: #a855f7;
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.2);
    --danger: #f43f5e;
    --danger-hover: #e11d48;
    --warning: #f59e0b;
    --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 40%, #1e1b4b 100%);
    --card-bg: rgba(17, 24, 39, 0.6);
    --card-border: rgba(255, 255, 255, 0.07);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    --font-outfit: 'Outfit', 'Inter', sans-serif;
    --font-inter: 'Inter', sans-serif;
    --glass-blur: blur(20px);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-inter);
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.6;
    padding: 40px 20px;
}

/* Background Glowing Orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.35;
    pointer-events: none;
    animation: floatOrb 12s infinite alternate ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    right: -100px;
    animation-delay: -4s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.1); }
}

/* Container */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-family: var(--font-outfit);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #ffffff, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Glassmorphism Card */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-premium);
    margin-bottom: 30px;
    transition: var(--transition-smooth);
}

/* Survey Questions styling */
.question-group {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.question-group:last-child {
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.question-title {
    font-family: var(--font-outfit);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: #ffffff;
    display: flex;
    align-items: flex-start;
}

.question-num {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

/* Custom Checkbox and Radio styling */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

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

.checkmark {
    height: 20px;
    width: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    margin-right: 14px;
    display: inline-block;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

/* Radio checkmark (circle) */
.option-item input[type="radio"] ~ .checkmark {
    border-radius: 50%;
}

/* Checkbox checkmark (rounded rect) */
.option-item input[type="checkbox"] ~ .checkmark {
    border-radius: 5px;
}

/* Checked state */
.option-item input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Inner indicator */
.checkmark::after {
    content: "";
    position: absolute;
    display: none;
}

.option-item input[type="radio"] ~ .checkmark::after {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.option-item input[type="checkbox"] ~ .checkmark::after {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    margin-top: -1px;
}

.option-item input:checked ~ .checkmark::after {
    display: block;
}

.option-item input:checked ~ .option-label {
    color: #ffffff;
    font-weight: 500;
}

.option-label {
    font-size: 0.95rem;
    color: var(--text-main);
    transition: var(--transition-smooth);
}

/* Custom Text Input for '기타' */
.other-input-container {
    margin-top: 8px;
    display: none; /* Controlled by JS */
    animation: slideDown 0.3s ease-out forwards;
}

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

.custom-text-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.custom-text-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

/* Textarea styling */
.textarea-container {
    position: relative;
    width: 100%;
}

.custom-textarea {
    width: 100%;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    color: #ffffff;
    font-family: var(--font-inter);
    font-size: 0.95rem;
    outline: none;
    resize: vertical;
    transition: var(--transition-smooth);
}

.custom-textarea:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

/* NPS 0-10 Button Scale */
.nps-scale {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.nps-btn {
    flex: 1;
    min-width: 40px;
    height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    color: var(--text-muted);
    font-family: var(--font-outfit);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

/* Custom Hover Effects for NPS Buttons based on scores */
/* 0-6 Detractors: Red Hover */
.nps-btn[data-score="0"]:hover, .nps-btn[data-score="1"]:hover, .nps-btn[data-score="2"]:hover,
.nps-btn[data-score="3"]:hover, .nps-btn[data-score="4"]:hover, .nps-btn[data-score="5"]:hover,
.nps-btn[data-score="6"]:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: var(--danger);
    color: var(--danger);
    transform: translateY(-3px);
}

/* 7-8 Passives: Yellow Hover */
.nps-btn[data-score="7"]:hover, .nps-btn[data-score="8"]:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning);
    color: var(--warning);
    transform: translateY(-3px);
}

/* 9-10 Promoters: Green Hover */
.nps-btn[data-score="9"]:hover, .nps-btn[data-score="10"]:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}

/* Selected state */
.nps-btn.selected[data-score="0"], .nps-btn.selected[data-score="1"], .nps-btn.selected[data-score="2"],
.nps-btn.selected[data-score="3"], .nps-btn.selected[data-score="4"], .nps-btn.selected[data-score="5"],
.nps-btn.selected[data-score="6"] {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
}

.nps-btn.selected[data-score="7"], .nps-btn.selected[data-score="8"] {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--text-dark);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.nps-btn.selected[data-score="9"], .nps-btn.selected[data-score="10"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.nps-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0 4px;
}

/* Form Action Buttons */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 14px;
    color: white;
    padding: 16px 24px;
    font-family: var(--font-outfit);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.25);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

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

.submit-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Modals (Success & Detail View) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-premium);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: inline-block;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.modal-title {
    font-family: var(--font-outfit);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ffffff;
}

.modal-body {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.modal-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 24px;
    font-family: var(--font-outfit);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-btn:hover {
    background: #ffffff;
    color: var(--text-dark);
}

/* ==========================================================================
   Admin Dashboard Specific Styles
   ========================================================================== */

.admin-header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 25px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-family: var(--font-outfit);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.action-btn.primary {
    background: var(--primary);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-btn.danger {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.2);
    color: var(--danger);
}

.action-btn.danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.stat-card.nps-stat::before {
    background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
}

.stat-card.nps-stat.nps-neutral::before {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.stat-card.nps-stat.nps-negative::before {
    background: linear-gradient(90deg, #f87171 0%, #ef4444 100%);
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-outfit);
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-premium);
}

.chart-card-title {
    font-family: var(--font-outfit);
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

.chart-container {
    position: relative;
    height: 240px;
    width: 100%;
}

/* Admin Login Card */
.login-card {
    max-width: 420px;
    margin: 80px auto;
}

.login-card h2 {
    font-family: var(--font-outfit);
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-align: center;
    margin-bottom: 10px;
}

.login-card p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

/* Responses Table card */
.table-card {
    overflow: hidden;
    padding: 0;
}

.table-header-bar {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.table-title {
    font-family: var(--font-outfit);
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.search-filter-wrapper {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 450px;
}

.search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 16px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

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

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

.premium-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 24px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.premium-table td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    white-space: nowrap;
}

.premium-table tbody tr {
    transition: var(--transition-smooth);
}

.premium-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.premium-table tbody tr:last-child td {
    border-bottom: none;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.score-badge.promoter {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
}

.score-badge.passive {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.score-badge.detractor {
    background: rgba(244, 63, 94, 0.15);
    color: var(--danger);
}

.detail-view-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.detail-view-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
}

/* Detail Modal */
.detail-modal-content {
    max-width: 650px;
    text-align: left;
    max-height: 90vh;
    overflow-y: auto;
}

.detail-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-modal-title {
    font-family: var(--font-outfit);
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
}

.detail-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.detail-modal-close:hover {
    color: white;
}

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 15px;
}

.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.detail-value-text {
    font-size: 0.95rem;
    color: white;
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
}

.nps-block {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 8px 16px;
}

.nps-block-score {
    font-family: var(--font-outfit);
    font-size: 1.5rem;
    font-weight: 800;
}

.empty-state {
    padding: 60px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Responsive Overrides */
@media (max-width: 600px) {
    body {
        padding: 20px 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 24px;
        border-radius: 16px;
    }
    
    .nps-scale {
        gap: 4px;
    }
    
    .nps-btn {
        min-width: 32px;
        height: 38px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .table-header-bar {
        padding: 16px;
    }
}
