/* Common Styles */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1F2937;
    background: #FFFFFF;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 20px;
}

.logo img {
    height: 40px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links a {
    color: #4B5563;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #3B82F6;
}

/* Dropdown Styles */
.has-dropdown {
    position: relative;
}

.has-dropdown > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.has-dropdown > a::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-left: 0.5rem;
}

.has-dropdown:hover > a {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.has-dropdown:hover > a::after {
    transform: rotate(-135deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 240px;
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.75rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    display: block;
    margin: 0;
    padding: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #4B5563;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.95rem;
}

.dropdown-menu a:hover {
    background-color: #F3F4F6;
    color: #3B82F6;
    padding-left: 2rem;
}

.dropdown-menu a.active {
    color: #3B82F6;
    background-color: #F3F4F6;
    font-weight: 500;
}

/* Menu Button */
.menu-button {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
}

.menu-button span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #4B5563;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Menu Button Animation */
.menu-button.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.menu-button.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Footer */
.footer {
    background: #1F2937;
    color: #F9FAFB;
    padding: 60px 0 20px;
}

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

.footer-section h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.footer-section p {
    color: #9CA3AF;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #3B82F6;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.social-links a:hover img {
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #374151;
    color: #9CA3AF;
}

/* Common Components */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #3B82F6;
    color: white;
}

.btn-primary:hover {
    background: #2563EB;
}

.btn-outline {
    background: transparent;
    border: 2px solid #3B82F6;
    color: #3B82F6;
}

.btn-outline:hover {
    background: #3B82F6;
    color: white;
}

/* Common Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Animation */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #F3F4F6;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 250px;
    padding: 15px;
    border-radius: 6px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    width: 20px;
    height: 20px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.toast-success {
    border-left: 4px solid #10B981;
}

.toast-success .toast-icon {
    background-image: url('../images/icons/icon-success.svg');
}

.toast-error {
    border-left: 4px solid #EF4444;
}

.toast-error .toast-icon {
    background-image: url('../images/icons/icon-error.svg');
}

.toast-warning {
    border-left: 4px solid #F59E0B;
}

.toast-warning .toast-icon {
    background-image: url('../images/icons/icon-warning.svg');
}

.toast-info {
    border-left: 4px solid #3B82F6;
}

.toast-info .toast-icon {
    background-image: url('../images/icons/icon-info.svg');
}

/* Performance Optimizations */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.lazy.loaded {
    opacity: 1;
}

/* Content Visibility Optimizations */
.off-screen {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Loading States */
.loading {
    position: relative;
    min-height: 200px;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3B82F6;
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.3s ease;
}

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

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: black;
        background: white;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (forced-colors: active) {
    .button {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 1px solid currentColor;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .menu-button {
        display: flex;
        transition: all 0.3s ease;
    }

    .menu-button.show .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-button.show .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-button.show .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        transition: all 0.3s ease;
        overflow-y: auto;
    }

    .nav-links.show {
        right: 0;
    }

    .navbar.show {
        background-color: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-item {
        width: 100%;
        margin: 0.5rem 0;
    }

    .dropdown .dropdown-menu {
        position: static;
        width: 100%;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        padding: 0;
        margin: 0;
        transition: all 0.3s ease;
        box-shadow: none;
        background-color: #f8f9fa;
    }

    .dropdown.show .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 500px;
        padding: 1rem;
        margin-top: 0.5rem;
    }
}

/* Error States */
.error-message {
    color: #DC2626;
    font-size: 0.875rem;
    margin-top: 4px;
}

.error-input {
    border-color: #DC2626 !important;
}

/* Success States */
.success-message {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Disabled States */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Focus States */
:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Page Transition */
.page-transition {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: #1F2937;
    margin-bottom: 1rem;
}

.section-title p {
    color: #6B7280;
    font-size: 1.1rem;
}

/* Common Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

/* Animation for dropdown items */
.dropdown-menu li {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    transition-delay: calc(var(--item-index) * 0.05s);
}

.has-dropdown:hover .dropdown-menu li {
    opacity: 1;
    transform: translateY(0);
}

/* Active dropdown parent highlight */
.has-dropdown.active > a {
    color: #3B82F6;
    background-color: rgba(59, 130, 246, 0.1);
} 