/**
 * QUIZZ APP - Main Stylesheet
 * Modern, Clean, Responsive Design
 */

:root {
    --primary: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #f8fafc;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   HEADER
   ============================================ */
.main-header {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Header Left - Logo & User/Menu */
.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Logo - Small on Left */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.logo ion-icon {
    font-size: 1.5rem;
    color: var(--primary-light);
}

/* Header Secondary - User Name + Menu inline */
.header-secondary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
}

/* User Info - Right Side */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #FFFFFF;
}

/* Header Right - User & Logout */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Navigation - Next to User Name */
.header-nav {
    display: flex;
    gap: 1rem;
}

.header-nav a {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.8rem;
    transition: color 0.2s;
    text-decoration: none;
}

.header-nav a:hover {
    color: #FFFFFF;
}

/* Logout Button - White Text */
.btn-logout {
    background: transparent;
    border: 2px solid #FFFFFF;
    color: #FFFFFF !important;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #FFFFFF;
    color: var(--bg-dark) !important;
}

.btn-logout ion-icon {
    font-size: 1.1rem;
    color: #FFFFFF;
}

.btn-logout:hover ion-icon {
    color: var(--bg-dark);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-dark);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--border);
    color: var(--text-dark);
}

.btn-icon.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-google:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.alert ion-icon {
    font-size: 1.5rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 150px);
}

.main-footer {
    background: var(--bg-dark);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

/* ============================================
   AUTH PAGE
   ============================================ */
.auth-page {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a5f 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    width: 100%;
}

.auth-card {
    background: white;
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    margin-bottom: 1.5rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-features {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    color: white;
}

.feature {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feature-icon {
    font-size: 2.5rem;
}

.feature h3 {
    font-size: 1.25rem;
}

.feature p {
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-header,
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
}

.breadcrumb {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Quiz Cards Grid */
.quiz-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.quiz-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.quiz-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.quiz-card-header h3 {
    font-size: 1.15rem;
    line-height: 1.4;
    font-weight: 600;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.quiz-card-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-card-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.quiz-card-actions .btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.5rem 1rem;
}

.quiz-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.quiz-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-light);
    padding: 0.5rem;
    border-radius: 8px;
}

.quiz-link input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    color: var(--text-muted);
    outline: none;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
}

.btn-copy:hover {
    color: var(--primary);
}

/* ============================================
   FORMS
   ============================================ */
.quiz-form {
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.form-section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.form-section h2 ion-icon {
    color: var(--primary);
}

.section-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.section-description code {
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.required {
    color: var(--danger);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.current-image {
    margin-top: 0.75rem;
}

.current-image img {
    max-width: 150px;
    border-radius: 8px;
}

.current-image small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
}

/* Theme Selector */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.theme-option {
    cursor: pointer;
}

.theme-option input {
    display: none;
}

.theme-preview {
    padding: 1.25rem 1rem;
    border-radius: 8px;
    text-align: center;
    border: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.theme-option input:checked + .theme-preview {
    border-color: var(--primary);
}

.theme-accent {
    display: block;
    width: 30px;
    height: 6px;
    border-radius: 3px;
    margin: 0 auto 0.75rem;
}

.theme-name {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-item input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.checkbox-item.inline {
    display: inline-flex;
}

/* Questions */
.question-item {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-number {
    font-weight: 600;
    color: var(--primary);
}

.question-actions {
    display: flex;
    gap: 0.25rem;
}

.options-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.options-list {
    margin-bottom: 0.75rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.option-item input {
    flex: 1;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* ============================================
   RESPONSES TABLE
   ============================================ */
.header-stats {
    display: flex;
    gap: 1rem;
}

.stat-box {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.responses-table-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.responses-table {
    width: 100%;
    border-collapse: collapse;
}

.responses-table th,
.responses-table td {
    padding: 1rem 1.25rem;
    text-align: left;
}

.responses-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.responses-table tbody tr {
    border-top: 1px solid var(--border);
}

.responses-table tbody tr:hover {
    background: var(--bg-light);
}

.quiz-link-box {
    display: flex;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}

.quiz-link-box input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Response Detail */
.response-detail-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.response-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.response-section {
    margin-bottom: 2rem;
}

.response-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.respondent-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
}

.info-item strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.info-item a {
    color: var(--primary);
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-item {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.answer-question {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.answer-value {
    font-size: 1.05rem;
}

.answer-value ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .auth-features {
        display: none;
    }
    
    /* Header Mobile Layout */
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-left {
        flex: 1;
    }
    
    .logo-img {
        height: 28px;
    }
    
    .header-nav {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .btn-logout {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Quiz Cards Mobile */
    .quiz-card-actions {
        flex-wrap: wrap;
    }
    
    .quiz-card-footer {
        flex-wrap: wrap;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header,
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .response-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .logo-img {
        height: 32px;
    }
    
    .auth-logo-img {
        max-width: 180px;
    }
}

/* ============================================
   LOGO STYLES
   ============================================ */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.logo-img:hover {
    transform: scale(1.02);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: -0.5px;
}

/* Auth Page Logo */
.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.auth-logo-img {
    max-width: 220px;
    height: auto;
    object-fit: contain;
}

.auth-tagline {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.auth-header h1 {
    display: none; /* Hidden since logo has text */
}

