/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span:first-child {
    top: 0;
}

.mobile-menu-toggle span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-toggle span:last-child {
    bottom: 0;
}

.mobile-menu-toggle.active span:first-child {
    transform: translateY(11px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:last-child {
    transform: translateY(-11px) rotate(-45deg);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 9999; /* ensure it appears above other elements */
    }

    .main-nav.active {
        max-height: 400px;
        padding: 15px 0;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }

    .main-nav li {
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 10px 0;
    }

    .main-nav a {
        display: block;
        padding: 8px 0;
    }

    .main-nav a::after {
        display: none;
    }
}

/* Loading Animation */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--secondary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    color: var(--text-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--accent-color);
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* Accessibility Improvements */
:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    z-index: 100;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}