/* ========================================
   Research Survey Management System
   Custom Styles - Mutalex Academy Design System
   ======================================== */

:root {
    --primary: #1e3a8a;
    --primary-light: #2563eb;
    --primary-dark: #1e40af;
    --accent: #10b981;
    --accent-dark: #059669;
    --accent-light: #d1fae5;
    --purple: #6366f1;
    --purple-dark: #4f46e5;
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --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-lg: 16px;
    --radius-xl: 20px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* General */
body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================
   HEADER - Matches LMS header.partial.php
   ============================================ */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

.site-logo {
    max-height: 40px;
    max-width: 150px;
    object-fit: contain;
}

.logo a:hover {
    color: var(--primary-dark);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--primary-light);
    background-color: #f1f5f9;
}

.nav-link.active {
    color: var(--primary-light);
    background-color: #eff6ff;
}

.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-light);
    background: none;
    border: none;
    padding: 0.5rem;
    margin: 0;
    transition: var(--transition);
    z-index: 1002;
}

.mobile-menu-toggle:hover {
    color: var(--primary-light);
    transform: scale(1.1);
}

/* ============================================
   HERO SECTION - Matches LMS home.php hero
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.25rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section .lead {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    color: #c7d2fe;
    line-height: 1.6;
}

.hero-section .btn-light {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.hero-section .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    color: white;
}

/* ============================================
   CARDS - Matches LMS card styling
   ============================================ */
.card {
    border-radius: var(--radius-lg);
    transition: var(--transition);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: var(--bg-white);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: #d1d5db;
}

.card-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* Survey Cards - Public Homepage */
.survey-card {
    transition: var(--transition);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.survey-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl) !important;
    border-color: #d1d5db;
}

.survey-card .card-body {
    padding: 1.5rem;
}

/* ============================================
   BADGES - Matches LMS badge styling
   ============================================ */
.badge {
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white;
}

.badge.bg-secondary {
    background: #f3f4f6 !important;
    color: var(--text-light);
}

/* ============================================
   BUTTONS - Matches LMS button styling
   ============================================ */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e3a8a 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    color: white;
}

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

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-light);
    color: var(--primary-light);
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    color: white;
}

.btn-outline-success {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline-success:hover {
    background: var(--accent);
    color: white;
}

.btn-sm {
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-group-sm > .btn {
    border-radius: 6px;
}

/* ============================================
   FORMS - Matches LMS form styling
   ============================================ */
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text);
    background: #f9fafb;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: white;
    outline: none;
}

.form-control-lg {
    padding: 0.75rem 1rem;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ============================================
   TABLES - Matches LMS table styling
   ============================================ */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: none;
    color: var(--text-light);
    padding: 0.75rem 1rem;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    border-color: var(--border);
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* ============================================
   NAVBAR - Override Bootstrap navbar
   ============================================ */
.navbar {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-light) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--text-light) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: var(--transition);
    font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--primary-light) !important;
    background: #f1f5f9;
}

.navbar-dark .navbar-nav .nav-link.active {
    color: var(--primary-light) !important;
    background: #eff6ff;
}

/* ============================================
   FOOTER - Matches LMS footer styling
   ============================================ */
.footer {
    font-size: 0.85rem;
    background: var(--bg-white) !important;
    border-top: 1px solid var(--border) !important;
    padding: 1.5rem 0;
    color: var(--text-light);
}

/* ============================================
   STATS CARDS - Matches admin dashboard
   ============================================ */
.stat-card {
    transition: var(--transition);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-white);
    padding: 1.5rem;
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
    background: var(--border-light);
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
}

/* ============================================
   MODAL
   ============================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.alert-dismissible .btn-close {
    padding: 1.25rem;
}

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary-light);
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border: 1px solid var(--border);
    border-radius: 8px !important;
    margin: 0 2px;
    color: var(--text-light);
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
    font-weight: 500;
}

.page-link:hover {
    background: #f1f5f9;
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: white;
}

/* ============================================
   LIST GROUP
   ============================================ */
.list-group-item {
    border-color: var(--border);
    padding: 1rem 1.25rem;
    transition: var(--transition);
}

.list-group-item:hover {
    background: #f8fafc;
}

.list-group-item:first-child {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h5 {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
}

/* ============================================
   QUESTION BUILDER
   ============================================ */
.question-item {
    transition: var(--transition);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.question-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================
   SURVEY TYPE COLORS
   ============================================ */
.survey-type-quantitative { border-left: 4px solid var(--primary-light); }
.survey-type-qualitative { border-left: 4px solid var(--accent); }
.survey-type-mixed { border-left: 4px solid #f59e0b; }

/* ============================================
   SECTION HEADERS - Matches LMS
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.15rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   DASHBOARD SPECIFIC
   ============================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.dashboard-header p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-wrapper {
        padding: 0.75rem 15px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
        min-height: 300px;
    }
    
    .hero-section h1 {
        font-size: 2.3rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .stat-card .stat-number {
        font-size: 2rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .no-print { display: none !important; }
    body { background: white; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner-custom {
    width: 3rem;
    height: 3rem;
    border-width: 0.25rem;
    border-color: var(--primary-light) transparent var(--primary-light) transparent;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================
   CONTAINER OVERRIDE
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
   LINK STYLING
   ============================================ */
a {
    color: var(--primary-light);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   TEXT COLORS
   ============================================ */
.text-primary {
    color: var(--primary-light) !important;
}

.text-success {
    color: var(--accent) !important;
}

.text-muted {
    color: var(--text-light) !important;
}