/* Base CSS for all pages - Fixed for compatibility */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #06b6d4;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --background: #ffffff;
    --background-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

/* Navigation-specific container to avoid conflicts */
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles - Specific to navigation */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar {
    padding: 1rem 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* Mobile menu animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* App-specific actions */
.app-actions {
    display: flex;
    gap: 0.75rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.app-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: var(--background);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        border-top: 1px solid var(--border-color);
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        padding: 1rem;
        display: block;
    }
    
    .app-actions {
        flex-direction: column;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        margin-left: 0;
        padding: 1rem 0 0 0;
        margin-top: 1rem;
    }
    
    .app-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Template-specific styles (for privacy, terms, etc pages) */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

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

/* Footer Styles - Only for template pages */
.site-footer {
    background: var(--background-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

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

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Page Content Styles - For template pages */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.content-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--background);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.content-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-section h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
    color: var(--text-primary);
}

.content-section p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.content-section ul,
.content-section ol {
    margin-bottom: 1rem;
    margin-left: 2rem;
    color: var(--text-secondary);
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* Fix for main app - ensure no blur or interference */
body > .container {
    filter: none !important;
    backdrop-filter: none !important;
    transform: none !important;
}

/* Ensure proper stacking */
.image-comparison-section,
.bottom-section,
.actions-panel,
.history-panel {
    position: relative;
    z-index: 1;
    filter: none !important;
}

/* Ensure modals are above everything */
.upload-modal {
    z-index: 2000;
}

.loading-overlay {
    z-index: 3000;
}

.toast-container {
    z-index: 4000;
}