/**
 * main.css - Main stylesheet for Stargate Framework website
 * Author: David (davestj)
 * Purpose: Shared styles optimized for MacBook 15" (1440x900) and presentation screens
 */

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

/* Root variables for consistent theming */
:root {
    --primary-color: #3fbac2;
    --secondary-color: #1a1a2e;
    --dark-bg: #0d1117;
    --light-bg: #f5f7fa;
    --text-primary: #2c3e50;
    --text-light: #ffffff;
    --text-muted: #7f8c8d;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    
    /* MacBook 15" optimized container widths */
    --container-max: 1440px;
    --container-large: 1200px;
    --container-medium: 960px;
    
    /* Responsive font sizes that scale well */
    --font-base: 16px;
    --font-small: 0.875rem;
    --font-large: 1.125rem;
    --font-xlarge: 1.5rem;
    --font-xxlarge: 2rem;
}

/* Base typography - optimized for readability */
html {
    font-size: var(--font-base);
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Navigation Styles */
.main-navigation {
    background: var(--secondary-color);
    color: var(--text-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.nav-brand a {
    text-decoration: none;
    color: var(--text-light);
}

.nav-brand h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

.nav-brand .tagline {
    font-size: var(--font-small);
    color: var(--primary-color);
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
    align-items: center;
}

.nav-item a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: var(--font-small);
    white-space: nowrap;
}

.nav-item a:hover,
.nav-item.active a {
    background: rgba(63, 186, 194, 0.2);
    color: var(--primary-color);
}

/* Mobile menu toggle (hidden on desktop) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    margin: 2px 0;
    transition: 0.3s;
}

/* Main Content Area */
.main-content {
    flex: 1;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem;
}

/* Footer Styles */
.main-footer {
    background: var(--secondary-color);
    color: var(--text-light);
    margin-top: auto;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem;
}

.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(--primary-color);
}

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

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

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

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
}

.status-dot.active {
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--font-small);
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: var(--container-large);
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.small-text {
    font-size: var(--font-small);
}

.copyright {
    margin-top: 1rem;
    opacity: 0.8;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background: #45d3db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 186, 194, 0.3);
}

.btn-secondary {
    background: var(--text-muted);
    color: var(--text-light);
}

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

/* Card Components */
.card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.card h2,
.card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Grid Systems */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Responsive Design - MacBook 15" and larger screens */
@media (min-width: 1440px) {
    /* Optimized for MacBook 15" native resolution */
    :root {
        --font-base: 18px;
    }
    
    .main-content {
        padding: 3rem 2rem;
    }
    
    .nav-item a {
        font-size: 1rem;
        padding: 0.75rem 1.25rem;
    }
}

/* Large presentation screens (4K TVs) */
@media (min-width: 2560px) {
    :root {
        --font-base: 24px;
        --container-max: 2400px;
    }
    
    .main-navigation {
        min-height: 100px;
    }
    
    .nav-brand h1 {
        font-size: 2rem;
    }
}

/* Tablet and smaller laptops */
@media (max-width: 1024px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--secondary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    :root {
        --font-base: 14px;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Print styles for documentation */
@media print {
    .main-navigation,
    .main-footer {
        display: none;
    }
    
    .main-content {
        max-width: 100%;
        padding: 0;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Loading states */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(63, 186, 194, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

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