/* Base styles for Design & Build Portal */
/* Global reset, typography, and fundamental styling */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, 'Inter', sans-serif);
    background: #f8f9fa;
    color: var(--text-primary, #333);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings, 'Playfair Display', Georgia, serif);
    font-weight: 600;
    color: var(--text-primary, #333);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary, #666);
}

strong {
    color: var(--text-primary, #333);
    font-weight: 600;
}

/* Links */
a {
    color: var(--primary-teal, #7ECBC0);
    text-decoration: none;
    transition: color var(--transition-fast, 0.2s);
}

a:hover {
    color: var(--primary-teal-hover, #6ab9ae);
}

/* Navigation */
.nav {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-brand {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

.nav-brand:hover {
    text-decoration: none;
}

/* Environment Badge */
.env-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    line-height: 1;
}

.env-staging {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
}

.env-production {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    font-weight: 700;
}

.env-preview {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary, #666);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all var(--transition-fast, 0.2s);
}

.nav-link:hover {
    background: rgba(126, 203, 192, 0.12);
    color: var(--text-primary, #333);
    text-decoration: none;
}

.nav-link.active {
    background: var(--primary-teal, #7ECBC0);
    color: white;
}

.nav-link.active:hover {
    background: var(--primary-teal-hover, #6ab9ae);
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    min-width: 180px;
    margin-top: 4px;
}

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

.nav-dropdown .dropdown-item {
    display: block;
    padding: 10px 16px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    margin: 4px;
    transition: all 0.2s;
    font-size: 14px;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.nav-dropdown .dropdown-item:hover {
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
}

/* Analytics Sub-Navigation */
.analytics-sub-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
}

.analytics-sub-nav .container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.breadcrumb h1 {
    font-size: 24px;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
}

.sub-nav-tabs {
    display: flex;
    gap: 0;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.sub-nav-link {
    color: #666;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px 6px 0 0;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-bottom: none;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    margin-right: 2px;
}

.sub-nav-link:hover {
    background: #dee2e6;
    color: #333;
    text-decoration: none;
}

.sub-nav-link.active {
    background: white;
    color: var(--primary-teal, #7ECBC0);
    border-color: var(--primary-teal, #7ECBC0);
    position: relative;
}

.sub-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: white;
}

/* Main content area */
.main-content {
    min-height: calc(100vh - 120px);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body, 'Raleway', sans-serif);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--primary-teal, #7ECBC0);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-teal-hover, #6ab9ae);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn.btn-lg {
    min-height: 48px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.btn-success {
    background: var(--primary-teal, #7ECBC0);
    color: white;
}

.btn-success:hover {
    background: var(--primary-teal-hover, #6ab9ae);
}

.btn-danger {
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #b91c1c;
}

.btn-create {
    background: var(--primary-teal, #7ECBC0);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    min-height: 38px;
}

.btn-create:hover {
    background: var(--primary-teal-hover, #6ab9ae);
    color: white;
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Card styles moved to /styles/components.css */

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 16px 20px;
    margin-top: 40px;
}

.footer-container {
    max-width: 1600px;
    margin: 0 auto;
    color: #666;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    display: flex;
    align-items: center;
}

.footer-right {
    color: #999;
}

/* Utility classes moved to /styles/utilities.css */

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none !important; /* Force hide on mobile */
    }
    
    .nav-right {
        display: none !important; /* Hide right nav items on mobile too */
    }
    
    .container {
        padding: 0 15px;
    }
    
    .nav-left {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-brand {
        font-size: 18px;
    }
    
    /* Ensure buttons are touch-friendly */
    .btn, .btn-create, .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-toggle {
        min-width: 48px;
        min-height: 48px;
    }
}

/* ===============================
   Mobile navigation toggle styles
   =============================== */

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
}

.nav-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

@media (max-width: 768px) {
    .nav-toggle { 
        display: inline-flex; 
        align-items: center; 
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Mobile nav container adjustments */
    .nav-left {
        width: 100%;
        position: relative;
    }
    
    /* When nav is open, create a dropdown container */
    .nav.open .nav-left {
        position: relative;
    }
    
    /* Show links in dropdown */
    .nav.open .nav-links { 
        display: flex !important; /* Override the hide */
        flex-direction: column;
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 10px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    .nav.open .nav-link {
        padding: 12px 16px;
        width: 100%;
        text-align: left;
        border-radius: 6px;
    }
    
    /* Show nav-right inside the dropdown */
    .nav.open .nav-right { 
        display: block !important;
        position: absolute;
        top: calc(100% + 180px); /* Position below nav-links dropdown */
        left: 0;
        right: 0;
        padding: 0 10px;
        z-index: 999;
    }
    
    .nav.open .nav-right .btn-create { 
        width: 100%; 
        justify-content: center;
        padding: 12px 20px;
        font-size: 16px;
    }
}
