/* Modern Glassmorphic Dark Design System for SurveyApp */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-base: #08090c;
    --bg-surface: rgba(17, 22, 34, 0.7);
    --bg-surface-hover: rgba(26, 32, 49, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(0, 229, 255, 0.4);
    
    --primary: #7c4dff; /* Neon Purple */
    --secondary: #00e5ff; /* Neon Cyan */
    --success: #00e676; /* Accent Green */
    --danger: #ff1744; /* Accent Red */
    --warning: #ffea00;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-glow: 0 0 25px rgba(124, 77, 255, 0.15);
    --shadow-glow-cyan: 0 0 25px rgba(0, 229, 255, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(124, 77, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 229, 255, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Authentication Screen (Full page center) */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    z-index: 10;
}

.auth-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    animation: fadeIn 0.5s ease;
}

.auth-logo {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Dashboard Core Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 280px;
    background: rgba(10, 12, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 30px 24px;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-user {
    padding: 10px 24px 20px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.user-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

.badge-super_admin {
    background: rgba(255, 23, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 23, 68, 0.3);
}

.badge-admin-vip {
    background: rgba(0, 229, 255, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

.badge-admin {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-nav {
    list-style: none;
    padding: 0 16px;
    flex-grow: 1;
}

.sidebar-nav li {
    margin-bottom: 6px;
}

.sidebar-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav li.active a,
.sidebar-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav li.active a {
    border-left: 3px solid var(--secondary);
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.08), transparent);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* Main Content Area */
.app-main {
    margin-left: 280px;
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.app-header {
    background: rgba(8, 9, 12, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
}

.app-content {
    padding: 40px;
    flex-grow: 1;
}

/* UI Elements & Cards */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.primary {
    background: rgba(124, 77, 255, 0.15);
    color: var(--primary);
    border: 1px solid rgba(124, 77, 255, 0.3);
}

.stat-icon.secondary {
    background: rgba(0, 229, 255, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.stat-icon.success {
    background: rgba(0, 230, 118, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Form switch toggle */
.switch-group {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 34px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--secondary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(124, 77, 255, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-success {
    background: var(--success);
    color: #0c0d14;
}

.btn-success:hover {
    background: #00c853;
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(255, 23, 68, 0.15);
    color: #ff5252;
    border: 1px solid rgba(255, 23, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 23, 68, 0.25);
    color: #ff1744;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* Survey Form Builder Layout */
.builder-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
}

@media (max-width: 992px) {
    .builder-container {
        grid-template-columns: 1fr;
    }
}

.question-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    transition: var(--transition);
    animation: slideUp 0.3s ease;
}

.question-card:hover {
    border-color: var(--border-color-focus);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.question-number {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--secondary);
    letter-spacing: 0.5px;
}

.question-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.options-editor {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 15px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.add-option-btn {
    background: transparent;
    border: none;
    color: var(--secondary);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
}

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

table.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

table.table th {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
}

table.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

/* Surveys list cards */
.survey-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.survey-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    position: relative;
    transition: var(--transition);
}

.survey-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-focus);
    box-shadow: var(--shadow-glow-cyan);
}

.survey-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

/* Survey View / Respondent styling */
.public-survey-body {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px;
    width: 100%;
}

.public-logo {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.survey-header-card {
    border-top: 6px solid var(--primary);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.survey-public-question {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.survey-public-question.required-error {
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(255, 23, 68, 0.15);
}

.question-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.req-star {
    color: var(--danger);
}

.response-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-secondary);
}

.response-option input[type="radio"],
.response-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--secondary);
}

/* Modal styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: var(--transition);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

/* Chart Styles & Flex layout for Analytics */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.chart-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

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

.report-summary-box {
    background: rgba(124, 77, 255, 0.05);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utility classes */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-gap {
    display: flex;
    gap: 12px;
    align-items: center;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-20 {
    margin-bottom: 20px;
}

.color-secondary {
    color: var(--secondary);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: rgba(255, 234, 0, 0.15);
    color: #ffd600;
}

.status-approved {
    background: rgba(0, 230, 118, 0.15);
    color: var(--success);
}

.status-rejected {
    background: rgba(255, 23, 68, 0.15);
    color: var(--danger);
}

/* Select options colors fix */
select.form-control option {
    background-color: #111622;
    color: var(--text-primary);
}

/* Sponsored Ad Section */
.ad-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.04));
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ad-badge {
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.ad-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 6px;
    margin-top: 4px;
}

.ad-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ad-upgrade-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
}

.ad-upgrade-link:hover {
    color: var(--secondary);
}
