/* Consistent Header Navigation Styles */

.main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e5e7eb;
}

.header-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Left Section - Logo */
.header-left .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #333;
}

.header-left .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.header-left .logo-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.header-left .logo-text {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Center Section - Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    width: 45px;
    height: 45px;
    min-width: 45px;
}

.header-nav .nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.header-nav .nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.header-nav .nav-link i {
    font-size: 18px;
}

/* RKCL Button Styles */
.rkcl-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-size: 14px;
}

.rkcl-nav-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.rkcl-nav-btn i {
    font-size: 16px;
}

.rkcl-nav-btn span {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* RSCIT Button Styles (keeping for backward compatibility) */
.rscit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    font-size: 14px;
}

.rscit-btn:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: white;
}

.rscit-btn i {
    font-size: 16px;
}

.rscit-btn span {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Back to Home Button Styles */
.back-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    font-size: 14px;
}

.back-home-btn:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    color: white;
}

.back-home-btn i {
    font-size: 16px;
}

.back-home-btn span {
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Right Section - User Actions */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}



.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    color: #667eea;
    font-weight: 500;
}

.user-info i {
    font-size: 18px;
}

.logout-btn, .login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.logout-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(238, 90, 82, 0.3);
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 10px;
    margin-right: 90px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}

.mobile-nav-overlay.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mobile-nav-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-mobile-menu {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.close-mobile-menu:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-nav-links {
    padding: 20px 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.mobile-nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.mobile-nav-link span {
    font-size: 16px;
}

/* RKCL Mobile Button Styles */
.rkcl-mobile-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    margin: 10px 20px;
    border-radius: 10px;
    border: none;
}

.rkcl-mobile-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white !important;
    transform: translateY(-2px);
}

/* RSCIT Mobile Button Styles (keeping for backward compatibility) */
.rscit-mobile-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white !important;
    margin: 10px 20px;
    border-radius: 10px;
    border: none;
}

.rscit-mobile-btn:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
    color: white !important;
    transform: translateY(-2px);
}

.logout-mobile {
    color: #ff6b6b !important;
}

.logout-mobile:hover {
    background: rgba(255, 107, 107, 0.1) !important;
    color: #ff6b6b !important;
}

/* Back to Home Mobile Button Styles */
.back-home-mobile-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white !important;
    margin: 10px 20px;
    border-radius: 10px;
    border: none;
}

.back-home-mobile-btn:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%);
    color: white !important;
    transform: translateY(-2px);
}

/* Mobile Navigation Section Styles */
.mobile-nav-section {
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
    padding-top: 20px;
}

.mobile-nav-section h4 {
    color: #667eea;
    font-size: 16px;
    font-weight: 600;
    margin: 0 20px 15px 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.rkcl-mobile-link {
    color: #666 !important;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.rkcl-mobile-link:hover {
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.1) !important;
    border-left-color: #667eea;
}

.rkcl-mobile-link i {
    color: #667eea;
    width: 20px;
    text-align: center;
}
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-nav-overlay.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.close-mobile-menu {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.close-mobile-menu:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.mobile-nav {
    padding: 20px 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #333;
    padding: 15px 20px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.mobile-nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-left-color: #667eea;
}

.mobile-nav-link.logout {
    color: #ff6b6b;
}

.mobile-nav-link.logout:hover {
    background: rgba(255, 107, 107, 0.1);
    border-left-color: #ff6b6b;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: rgba(102, 126, 234, 0.1);
    margin: 10px 20px;
    border-radius: 8px;
    color: #667eea;
    font-weight: 500;
}



/* Responsive Design */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    
    /* Show RKCL button on mobile for index page */
    body.index-page .rkcl-nav-btn {
        display: flex !important;
        position: absolute;
        right: 80px;
        top: 50%;
        transform: translateY(-50%);
        padding: 8px 12px;
        font-size: 12px;
    }
    
    body.index-page .rkcl-nav-btn span {
        display: none;
    }
    
    body.index-page .rkcl-nav-btn i {
        font-size: 16px;
    }
    .login-btn{
            margin-right: 10px;
    }
    
    .rscit-btn {
        display: none; /* Hide RSCIT button on mobile in header */
    }
    
    .back-home-btn {
        display: none; /* Hide Back to Home button on mobile in header */
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    .header-right {
        justify-content: space-evenly;
    }
    .main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position:fixed;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e5e7eb;
}
    
    .header-container {
        padding: 0 15px;
        position: relative;
    }
    
    .header-left .logo-text {
        font-size: 18px;
    }
    
    .header-left .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .header-left .logo-image {
        width: 35px;
        height: 35px;
    }
    
    /* Hide library selector on mobile in header */
    .header-library-selector {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-container {
        height: 60px;
        padding: 0 10px;
    }
    
    .header-left .logo-text {
        font-size: 16px;
    }
    .main-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position:fixed;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e5e7eb;
}
    
    .header-left .logo-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .header-left .logo-image {
        width: 30px;
        height: 30px;
    }
    
    .user-info span {
        display: none;
    }
    
    .logout-btn span, .login-btn span {
        display: none;
    }
    
    .mobile-nav-content {
        width: 280px;
    }
    
    /* iPhone XR and similar devices */
    body.index-page .rkcl-nav-btn {
        display: flex !important;
        position: absolute;
        right: 70px;
        top: 50%;
        transform: translateY(-50%);
        padding: 6px 10px;
        font-size: 11px;
        z-index: 1001;
    }
    
    body.index-page .rkcl-nav-btn span {
        display: none;
    }
    
    body.index-page .rkcl-nav-btn i {
        font-size: 10px;
    }
}

/* iPhone XR and similar devices - more reliable approach */
@media screen and (max-width: 414px) {
    body.index-page .rkcl-nav-btn {
        display: flex !important;
        position: absolute;
        right: 65px;
        top: 50%;
        transform: translateY(-50%);
        padding: 8px 12px;
        font-size: 10px;
        z-index: 1001;
        
    }
    .login-btn{
        padding: 12px 20px;
    }
    
    body.index-page .rkcl-nav-btn span {
        display: none;
    }
    
    body.index-page .rkcl-nav-btn i {
        font-size: 16px;
    }
}

/* Force show RKCL button on all mobile devices for index page */
@media (max-width: 768px) {
    body.index-page .rkcl-nav-btn {
        display: flex !important;
        position: absolute !important;
        right: 80px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        z-index: 1001 !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        border-radius: 10px !important;
        text-decoration: none !important;
        align-items: center !important;
        gap: 8px !important;
        font-weight: 600 !important;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    }
    
    body.index-page .rkcl-nav-btn span {
        display: none !important;
    }
    
    body.index-page .rkcl-nav-btn i {
        font-size: 28px !important;
        color: white !important;
    }
    
    body.index-page .rkcl-nav-btn:hover {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
        transform: translateY(-50%) translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
        color: white !important;
    }
    
    /* Mobile RKCL Button Styles */
    .mobile-rkcl-btn {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        text-decoration: none !important;
        color: white !important;
        font-weight: 600 !important;
        padding: 8px 12px !important;
        border-radius: 20px !important;
        transition: all 0.3s ease !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
        font-size: 12px !important;
        margin-right: 10px !important;
    }
    
    .mobile-rkcl-btn:hover {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
        color: white !important;
    }
    
    .mobile-rkcl-btn i {
        font-size: 14px !important;
        color: white !important;
    }
    
    .mobile-rkcl-btn span {
        display: none !important;
    }
    
    /* Mobile Back to Home Button Styles */
    .mobile-back-home-btn {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        text-decoration: none !important;
        color: white !important;
        font-weight: 600 !important;
        padding: 8px 12px !important;
        border-radius: 20px !important;
        transition: all 0.3s ease !important;
        background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3) !important;
        font-size: 12px !important;
        margin-right: 10px !important;
    }
    
    .mobile-back-home-btn:hover {
        background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
        color: white !important;
    }
    
    .mobile-back-home-btn i {
        font-size: 14px !important;
        color: white !important;
    }
    
    .mobile-back-home-btn span {
        display: none !important;
    }
}

/* iPhone XR landscape and similar */
@media screen and (max-width: 896px) and (max-height: 414px) {
    body.index-page .rkcl-nav-btn {
        display: flex !important;
        position: absolute;
        right: 80px;
        top: 50%;
        transform: translateY(-50%);
        padding: 8px 12px;
        font-size: 12px;
        z-index: 1001;
    }
    
    body.index-page .rkcl-nav-btn span {
        display: none;
    }
    
    body.index-page .rkcl-nav-btn i {
        font-size: 16px;
    }
}

/* Animation for header elements */
.header-left .logo:hover .logo-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.header-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.header-nav .nav-link:hover::after,
.header-nav .nav-link.active::after {
    width: 80%;
}
