/* Modern CSS Reset */
:root {
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --accent-primary: #2563eb;
    --accent-secondary: #3b82f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

/* App Container */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.logo svg {
    fill: var(--accent-primary);
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--accent-primary);
    color: white;
}

.nav-item i {
    width: 1.25rem;
    text-align: center;
}

.count {
    margin-left: auto;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
}

.user-profile {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    overflow: hidden;
}

.user-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Content Styles */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-options button {
    padding: 0.5rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0.25rem;
}

.view-options button:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.news-item {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.news-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.news-image-container {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.news-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    padding: 1.5rem;
}

.news-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Load More Button */
.load-more {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.load-more-btn:hover {
    background-color: var(--accent-secondary);
}

.load-more-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.back-to-top:hover {
    background-color: var(--accent-secondary);
    transform: translateY(-2px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background-color: var(--accent-primary);
    width: 0;
    transition: width 0.1s;
    z-index: 1000;
}

/* Search Results Count */
.search-results-count {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

/* Error Message */
.error-message {
    color: #ef4444;
    padding: 1rem;
    background-color: #fee2e2;
    border-radius: 0.5rem;
    margin: 1rem 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s;
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .main-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .header-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
    }

    .search-bar {
        width: 100%;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

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

.news-item {
    animation: fadeIn 0.3s ease-out;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

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

/* Contact Form Styles */
.contact-form {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.required {
    color: #ef4444;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

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

.validation-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.form-input.input-valid ~ .validation-icon::before {
    content: '\f058'; /* Font Awesome check circle icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--success-color);
    font-size: 16px;
}

.form-input.input-error ~ .validation-icon::before {
    content: '\f057'; /* Font Awesome times circle icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--error-color);
    font-size: 16px;
}

/* Special positioning for textarea validation icon */
.form-textarea ~ .validation-icon {
    top: 20px;
    transform: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: var(--accent-secondary);
}

.btn-text {
    margin-right: 0.5rem;
}

.loading-spinner {
    display: none;
    margin-left: 10px;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .loading-spinner {
    display: inline-block;
}

/* Form Success Message */
.form-success {
    display: none;
    padding: 1rem;
    margin-top: 1rem;
    background-color: #10b981;
    color: white;
    border-radius: 0.5rem;
    text-align: center;
}

/* Form Error Message */
.form-error {
    display: none;
    padding: 1rem;
    margin-top: 1rem;
    background-color: #fee2e2;
    color: #ef4444;
    border-radius: 0.5rem;
    text-align: center;
}

/* Responsive Form */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Validation Styles */
.form-group.error .form-input,
.form-group.error .form-textarea {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-group.error .validation-icon {
    color: #ef4444;
    opacity: 1;
}

.error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

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

/* Success Message Styles */
.success-message {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background-color: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
    z-index: 1000;
    max-width: 400px;
}

.success-message.active {
    transform: translateX(0);
}

.success-icon {
    font-size: 1.5rem;
}

.success-content h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.success-content p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.close-message {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-message:hover {
    opacity: 1;
}

/* Error Container Styles */
.error-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background-color: #fee2e2;
    color: #ef4444;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    max-width: 400px;
}

.error-icon {
    font-size: 1.5rem;
}

.error-content h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.error-content p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Particles Animation */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    z-index: 0;
}

@keyframes floating {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -20px); }
}

/* Responsive Messages */
@media (max-width: 768px) {
    .success-message,
    .error-container {
        top: auto;
        bottom: 2rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

/* Fix loading spinner visibility */
.loading-spinner {
    display: none;
    margin-left: 10px;
}

/* Button with loading state */
.btn .btn-text {
    transition: opacity 0.3s;
}

.btn:disabled {
    cursor: wait;
    opacity: 0.8;
}

/* Fix mobile menu z-index issues */
.menu-btn {
    z-index: 2000;
}

/* Fix sidebar transitions */
.sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1500;
}

.sidebar.active {
    transform: translateX(0);
}

/* Fix dark mode color transitions */
body.dark-mode .card-content h3 a,
body.dark-mode .blog-text h3 a,
body.dark-mode .resource-card-content h3 a {
    color: var(--dark-text-color);
    transition: color 0.3s;
}

body.dark-mode .card-content h3 a:hover,
body.dark-mode .blog-text h3 a:hover,
body.dark-mode .resource-card-content h3 a:hover {
    color: var(--primary-color);
}

/* Fix mobile view issues with profile cards */
@media (max-width: 576px) {
    .profile-card, 
    .profile-card-animated {
        max-width: 100%;
    }
    
    .profile-image-container {
        width: 140px;
        height: 140px;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 30px auto 0;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
}

/* Fix preloader animation */
.preloader-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    animation: preloaderDraw 2s ease forwards;
}

@keyframes preloaderDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Fix for social media links hover states */
.social-links a,
.profile-social a,
.contact-social a {
    transition: all 0.3s ease, background-color 0.3s ease;
}

/* Fix button focus states in dark mode */
body.dark-mode .btn:focus,
body.dark-mode .button:focus,
body.dark-mode .contact-link:focus {
    outline-color: var(--primary-color);
    background-color: var(--primary-color-hover);
    color: white;
}

/* Fix form elements in dark mode */
body.dark-mode .form-input:focus,
body.dark-mode .form-textarea:focus {
    border-color: var(--primary-color);
    background-color: var(--dark-background-color);
} 