/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #334155;
    background-color: #f8fafc;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #0f172a;
    font-weight: 600;
    line-height: 1.3;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: #0f172a;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.6s ease-out;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: inline-flex;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
}

.auth-header p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.form-group input:focus {
    outline: none;
    border-color: #0ea5e9;
    background: white;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-hint {
    color: #6b7280;
    font-size: 0.75rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #0ea5e9;
    border-color: #0ea5e9;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Links */
.forgot-link, .terms-link {
    color: #0ea5e9;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.forgot-link:hover, .terms-link:hover {
    color: #0284c7;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline, .btn-danger {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.btn-primary {
    background: #0ea5e9;
    color: white;
    border-color: #0ea5e9;
}

.btn-primary:hover {
    background: #0284c7;
    border-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-outline {
    background: transparent;
    color: #475569;
    border-color: #d1d5db;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #9ca3af;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
}

.auth-footer p {
    color: #6b7280;
    font-size: 0.875rem;
}

.auth-footer a {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    color: #0284c7;
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: #0ea5e9;
    background: #f0f9ff;
}

.nav-link.active {
    color: #0ea5e9;
    background: #f0f9ff;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: #64748b;
    transition: all 0.3s ease;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 144px);
    padding: 40px 0;
}

.page-header {
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out;
}

/* Dashboard */
.dashboard-page {
    background: #f8fafc;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.stat-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0ea5e9, #10b981);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.stat-label {
    color: #64748b;
    font-weight: 500;
}

/* Quick Links */
.quick-links-section {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.quick-link-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.quick-link-icon {
    width: 40px;
    height: 40px;
    background: #f0f9ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0ea5e9;
}

.quick-link-card h3 {
    color: #0f172a;
    font-size: 1.125rem;
    margin-bottom: 4px;
}

.quick-link-card p {
    color: #64748b;
    font-size: 0.875rem;
}

/* Profile */
.profile-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.profile-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    height: fit-content;
}

.profile-avatar {
    margin-bottom: 24px;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0ea5e9, #10b981);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
}

.profile-info h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.profile-role {
    color: #0ea5e9;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-since {
    color: #64748b;
    font-size: 0.875rem;
}

.profile-details {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-section h3 {
    margin-bottom: 24px;
    color: #0f172a;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.detail-item input {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.detail-item input[readonly] {
    background: #f9fafb;
    color: #6b7280;
}

.detail-item input:not([readonly]):focus {
    outline: none;
    border-color: #0ea5e9;
    background: white;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Resources */
.resources-filter {
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.filter-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-tab.active, .filter-tab:hover {
    background: #0ea5e9;
    color: white;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.resource-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.resource-thumbnail {
    height: 160px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.thumbnail-placeholder {
    color: #94a3b8;
}

.resource-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #0ea5e9;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.resource-content {
    padding: 24px;
}

.resource-content h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: #0f172a;
}

.resource-content p {
    color: #64748b;
    margin-bottom: 16px;
    line-height: 1.5;
}

.resource-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.resource-meta span {
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 4px;
}

/* Settings */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.settings-section {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.settings-card {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    margin-top: 16px;
}

.preference-group {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.preference-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.preference-info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: #0f172a;
}

.preference-info p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    cursor: pointer;
}

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

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: #0ea5e9;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* Danger Zone */
.danger-zone {
    border: 2px solid #fecaca;
    background: #fef2f2;
    padding: 24px;
    border-radius: 12px;
}

.danger-zone h3 {
    color: #dc2626;
    margin-bottom: 8px;
}

.danger-zone p {
    color: #7f1d1d;
    margin-bottom: 16px;
}

/* Logout Page */
.logout-card {
    text-align: center;
}

.logout-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.logout-info {
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.logout-info p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 24px 0;
    text-align: center;
}

.footer p {
    font-size: 0.875rem;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .page-title {
        font-size: 1.875rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        padding: 16px 0;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-link {
        padding: 12px 24px;
        border-radius: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .profile-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .preference-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .logout-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 16px;
    }
    
    .main-content {
        padding: 24px 0;
    }
    
    .page-header {
        margin-bottom: 24px;
    }
    
    .stats-grid, .quick-links-grid, .resources-grid {
        gap: 16px;
    }
    
    .stat-card, .settings-section {
        padding: 20px;
    }
    
    .filter-tabs {
        justify-content: flex-start;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .resources-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Utilities */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: fadeInUp 0.5s ease-out;
}

/* Focus States */
button:focus, input:focus, a:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid #e5e7eb;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.form-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 4px;
}

.input-error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

/* Success States */
.form-success {
    color: #10b981;
    font-size: 0.75rem;
    margin-top: 4px;
}

.input-success {
    border-color: #10b981 !important;
    background: #f0fdf4 !important;
}

/* Alert Messages */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
    animation: fadeInUp 0.3s ease-out;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
}