:root {
    --primary-color: #4A90E2;
    --secondary-color: #F39C12;
    --accent-color: #E74C3C;
    --dark-color: #2C3E50;
    --light-color: #ECF0F1;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.25);
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Global Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    border: 2px solid #f1f3f4;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #357ABD, #E67E22);
    box-shadow: 0 0 8px rgba(74, 144, 226, 0.3);
}

/* Firefox Global Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f3f4;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 70px;
    text-align: center;
}

.spinner > div {
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 100%;
    display: inline-block;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
    animation-delay: -0.32s;
}

.spinner .bounce2 {
    animation-delay: -0.16s;
}

@keyframes sk-bouncedelay {
    0%, 80%, 100% {
        transform: scale(0);
    } 40% {
        transform: scale(1.0);
    }
}

/* Sidebar Navigation */
.sidebar-nav {
    background: white;
    box-shadow: var(--shadow-medium);
    position: fixed;
    top: 0;
    left: 0;
    width: 25%;
    z-index: 1000;
    height: 100vh;
    padding: 0;
    overflow-y: auto;
    display: block;
    transition: all 0.3s ease;
}

/* Custom Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
    margin: 10px 0;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    border: 2px solid #f8f9fa;
    transition: all 0.3s ease;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #357ABD, #E67E22);
    border: 1px solid #f8f9fa;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

.sidebar-nav::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, #2E6DA4, #D35400);
}

/* Firefox Scrollbar */
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f8f9fa;
}

.nav-content {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Profile Section */
.profile-section {
    margin-bottom: 2rem;
    text-align: center;
}

.profile-img-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.profile-img-container:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-heavy);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(74, 144, 226, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.profile-overlay i {
    color: white;
    font-size: 1.5rem;
}

.profile-img-container:hover .profile-overlay {
    opacity: 1;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.profile-title {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: var(--shadow-medium);
    color: white;
}

/* Navigation */
.main-nav {
    flex: 1;
    margin-bottom: 2rem;
}

.nav-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    left: 0;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    transform: translateX(5px);
    text-decoration: none;
}

.nav-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link span {
    flex: 1;
}

/* Contact Info */
.profile-section {
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease;
}

.profile-img-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    cursor: pointer;
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.profile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(74, 144, 226, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.5rem;
}

.profile-img-container:hover .profile-overlay {
    opacity: 1;
}

.profile-img-container:hover .profile-img {
    transform: scale(1.05);
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.profile-title {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.profile-section .social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.profile-section .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50% !important;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
    position: relative;
}

.profile-section .social-link:hover {
    transform: scale(1.1);
    color: white;
}

/* Individual social link hover colors for profile section - REMOVED */

.profile-section .social-link i {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    text-align: center;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Navigation Menu */
.main-nav {
    flex: 1;
    margin-bottom: 2rem;
}

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

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    left: 0;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    transform: translateX(5px);
}

.nav-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 20px;
}

/* Contact Info */
.contact-info {
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.contact-item i {
    margin-right: 0.75rem;
    color: var(--primary-color);
    width: 16px;
}

/* Main Content */
.main-content {
    padding: 2rem;
    background: transparent;
    margin-left: 25%; /* Account for fixed sidebar */
}

.content-wrapper {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-medium);
    min-height: calc(100vh - 4rem);
    animation: fadeIn 0.8s ease;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1003;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: none; /* Hidden by default, shown on mobile */
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Show mobile menu toggle on mobile devices */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* ===============================================
   RESPONSIVE NAVIGATION FIXES
   =============================================== */

/* Desktop Navigation - Always Visible */
@media (min-width: 769px) {
    .sidebar-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 25%;
        z-index: 1000;
        height: 100vh;
        display: block !important;
        transform: translateX(0) !important;
        transition: none;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .main-content {
        margin-left: 25%;
        width: 75%;
        padding: 2rem;
    }
}

/* Tablet Navigation */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar-nav {
        width: 33.333333%;
    }
    
    .main-content {
        margin-left: 33.333333%;
        width: 66.666667%;
    }
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .sidebar-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 300px;
        z-index: 1002;
        transition: left 0.3s ease;
        height: 100vh;
        overflow-y: auto;
    }
    
    .sidebar-nav.active {
        left: 0;
    }
    
    .main-content {
        padding: 0.5rem;
        margin-left: 0;
        margin-top: 70px;
        width: 100%;
        min-height: calc(100vh - 70px);
    }
    
    .content-wrapper {
        padding: 1rem;
        min-height: auto;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .profile-name {
        font-size: 1.1rem;
    }
    
    /* Mobile Button Improvements */
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin: 0;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    /* Mobile Typography */
    .page-subtitle {
        font-size: 0.95rem;
        text-align: center;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }
    
    /* Mobile Spacing Improvements */
    .section {
        margin-bottom: 2rem;
        padding: 1rem;
    }
    
    .animate-on-scroll {
        margin-bottom: 1.5rem;
    }
    
    /* Mobile Card Improvements */
    .card, .stat-card, .service-item {
        margin-bottom: 1rem;
        box-shadow: var(--shadow-light);
    }
    
    /* Project controls mobile */
    .project-controls {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .project-controls .search-box {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .project-controls .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .project-controls .btn {
        flex: 1;
        min-width: 100px;
        margin: 0.25rem;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Contact form mobile */
    .contact-form .btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 1.1rem;
        margin-top: 1rem;
    }
    
    /* Pagination mobile */
    .pagination-container {
        margin: 2rem 0;
    }
    
    .pagination .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        margin: 0 0.25rem;
    }
    
    /* Card spacing mobile */
    .project-card {
        margin-bottom: 1.5rem;
    }
    
    .skill-item {
        margin-bottom: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .nav-content {
        padding: 1.5rem 1rem;
    }
    
    .profile-img-container {
        width: 100px;
        height: 100px;
    }
    
    .profile-section .social-links {
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .profile-section .social-link {
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
        border-radius: 50% !important;
        position: relative;
    }
    
    .profile-section .social-link i {
        font-size: 1.1rem;
        width: 100%;
        height: 100%;
        line-height: 1;
        text-align: center;
        margin: 0;
        padding: 0;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    /* Individual social link hover colors for mobile profile section - REMOVED */
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    /* Contact Page Mobile Styles */
    .contact-info-item {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .info-icon {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .social-links-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .social-link {
        padding: 0.65rem;
        font-size: 0.85rem;
    }
}

/* Custom Scrollbar */
.nav-content::-webkit-scrollbar {
    width: 6px;
}

.nav-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.nav-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.nav-content::-webkit-scrollbar-thumb:hover {
    background: #3a7bc8;
}

/* Contact Page Specific Styles */
.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
    word-wrap: break-word;
}

.contact-info-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.info-icon {
    background: var(--gradient-primary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.info-icon i {
    font-size: 1.1rem;
}

.info-content h5 {
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.info-content p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.info-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.info-content a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Social Connect Section */
.social-connect {
    margin-bottom: 2rem;
}

.social-connect h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.social-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.social-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.social-links-grid .social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: var(--shadow-light);
}

.social-link i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
    font-size: 1rem;
}

.social-links-grid .social-link.linkedin:hover {
    background: #0077b5;
}

.social-links-grid .social-link.github:hover {
    background: #333;
}

.social-links-grid .social-link.youtube:hover {
    background: #ff0000;
}

.social-links-grid .social-link.email:hover {
    background: #ea4335;
}

/* Text Utilities */
.nowrap {
    white-space: nowrap;
}

.text-wrap {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Footer Styles */
.portfolio-footer {
    margin-top: 4rem;
    padding: 2rem 0 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 3px solid transparent;
    border-image: var(--gradient-primary) 1;
    position: relative;
}

.portfolio-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.footer-content {
    padding: 0 2rem;
}

.footer-info .copyright {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 400;
}

.footer-credits .developed-by {
    margin: 0;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-credits .developed-by strong {
    color: var(--primary-color);
    font-weight: 600;
}

.footer-credits .developed-by i {
    color: var(--primary-color);
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
    margin: 1.5rem 0 1rem;
    opacity: 0.3;
}

.footer-bottom .footer-tagline {
    margin: 0;
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
    font-weight: 300;
}

/* Footer Responsive Design */
@media (max-width: 768px) {
    .portfolio-footer {
        margin-top: 2rem;
        padding: 1.5rem 0 1rem;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
    
    .footer-info,
    .footer-credits {
        text-align: center !important;
        margin-bottom: 1rem;
    }
    
    .footer-credits {
        margin-bottom: 0;
    }
    
    .footer-divider {
        margin: 1rem 0 0.5rem;
    }
}

@media (max-width: 576px) {
    .footer-info .copyright,
    .footer-credits .developed-by,
    .footer-bottom .footer-tagline {
        font-size: 0.8rem;
    }
}

/* Footer Responsive Design */
@media (max-width: 768px) {
    .footer-credits {
        text-align: center;
        padding: 1rem;
    }
    
    .footer-bottom {
        text-align: center;
        padding: 0.5rem;
    }
}

/* ===============================================
   RESPONSIVE UTILITIES & MOBILE OPTIMIZATION
   =============================================== */

/* Prevent horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Mobile viewport optimization */
@media (max-width: 576px) {
    .container, .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Extra small screens typography */
    .page-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .section-title {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Mobile spacing optimization */
    .main-content {
        padding: 0.25rem;
    }
    
    .content-wrapper {
        padding: 0.75rem;
    }
    
    .section {
        padding: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    /* Mobile button optimization */
    .btn {
        padding: 10px 15px;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    /* Mobile card optimization */
    .card {
        border-radius: 12px;
        box-shadow: var(--shadow-light);
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Tablet landscape optimization */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-content {
        padding: 1rem;
    }
    
    .content-wrapper {
        padding: 1.5rem;
    }
    
    .page-title {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
}

/* Large screen optimization */
@media (min-width: 1400px) {
    .content-wrapper {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .btn, .card, .filter-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .accordion-button {
        min-height: 48px;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover, .card:hover, .stat-card:hover {
        transform: none;
    }
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-title, .page-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        margin-top: 60px;
    }
    
    .sidebar-nav {
        width: 70%;
    }
    
    .page-title {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    .section {
        margin-bottom: 1rem;
        padding: 0.5rem;
    }
}

/* Focus indicators for accessibility */
.btn:focus, .form-control:focus, .accordion-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mobile-specific performance optimizations */
@media (max-width: 768px) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .animate-on-scroll {
        animation-duration: 0.3s;
    }
    
    /* Reduce shadows on mobile for better performance */
    .card, .btn, .stat-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* Print styles */
@media print {
    .sidebar-nav, .mobile-menu-toggle, .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        margin-top: 0 !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
        box-shadow: none !important;
    }
}

/* ===============================================
   NAVIGATION VISIBILITY FIXES
   =============================================== */

/* Ensure sidebar is always visible on desktop */
@media (min-width: 769px) {
    .sidebar-nav {
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
    
    .nav-link {
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
    }
    
    .nav-item {
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
    
    .main-nav {
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
}

/* Fix mobile navigation visibility */
@media (max-width: 768px) {
    .sidebar-nav {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .sidebar-nav.active .nav-link {
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
    }
    
    .mobile-menu-toggle {
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
    }
}

/* Global navigation fixes */
.nav-content,
.profile-section,
.main-nav,
.nav-list,
.nav-item,
.nav-link {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Image optimization for better loading */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Smooth fade-in for images */
.fade-in {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* SEO-friendly content structure */
.seo-content {
    margin-bottom: 2rem;
}

.seo-content h1,
.seo-content h2,
.seo-content h3 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

.seo-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

/* Focus indicators for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Performance optimization */
.will-change {
    will-change: transform, opacity;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
