/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables for easy theming */
:root {
    --primary-dark: #02094E;
    --primary-darker: #000428;
    --accent-blue: #1a2a6c;
    --accent-light: #b0c4de;
    --text-light: #e2e9f5;
    --text-dark: #333;
    --bg-light: #f5f5f5;
    --bg-card: #ffffff;
    --border-color: #ddd;
    --header-gradient: linear-gradient(135deg, #02094E 0%, #1a2a6c 100%);
    --section-bg: #f8f9fa;
    --link-color: #0066cc;
    --link-hover: #003366;
    --spacing-unit: 1rem;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--primary-dark);
}

.page-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-light);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Header Styles */
.site-header {
    background: var(--header-gradient);
    color: var(--text-light);
    padding: var(--spacing-unit);
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.site-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 35px;
    height: auto;
}

.current-date {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #ffd700;
    font-weight: 500;
}

/* Search Styles */
.search-container {
    max-width: 600px;
    margin: 1rem 0;
}

.search-form {
    width: 100%;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-button {
    background: #ffd700;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-button:hover {
    background: #ffed4a;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1000;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: 0.3s;
}

/* Main Layout */
.main-content {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
}

/* Sidebar Styles */
.sidebar-left,
.sidebar-right {
    background: transparent;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Section Cards */
.content-section {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.content-section:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.section-title {
    color: var(--primary-dark);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--accent-blue);
}

/* Link Lists */
.link-list {
    list-style: none;
}

.link-list li {
    margin-bottom: 0.5rem;
}

.link-list a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.95rem;
    display: inline-block;
    transition: color 0.2s, transform 0.2s;
}

.link-list a:hover {
    color: var(--link-hover);
    transform: translateX(3px);
}

/* Email and Shopping Links */
.email-links,
.shopping-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.email-link,
.shopping-link {
    background: var(--accent-light);
    color: var(--primary-dark);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.email-link:hover,
.shopping-link:hover {
    background: #9aaed0;
    transform: translateY(-2px);
}

/* Metals Grid */
.metals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metal-frame {
    width: 100%;
    height: 130px;
    border: 0;
    overflow: hidden;
    border-radius: 4px;
}

/* Video Containers */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.video-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Calculator Styles */
.calculator-form {
    width: 100%;
}

.calculator-display {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.2rem;
    text-align: right;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background: white;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.calc-btn {
    padding: 1rem 0.5rem;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.calc-btn:hover {
    background: #e0e0e0;
    transform: scale(0.98);
}

.calc-btn.operator {
    background: var(--accent-light);
    color: var(--primary-dark);
}

.calc-btn.operator:hover {
    background: #9aaed0;
}

.calc-btn.clear {
    background: #ff6b6b;
    color: white;
    border-color: #ff4757;
}

.calc-btn.clear:hover {
    background: #ff4757;
}

.calc-btn.equals {
    background: var(--accent-blue);
    color: white;
    border-color: var(--primary-darker);
}

.calc-btn.equals:hover {
    background: var(--primary-darker);
}

/* Responsive Images */
.responsive-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Footer */
.site-footer {
    background: var(--primary-dark);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 1rem;
}

.footer-link {
    color: #ffd700;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

.footer-logo {
    vertical-align: middle;
    margin: 0 0.5rem;
}

.last-update {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--accent-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 200px 1fr 200px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-content {
        grid-template-columns: 1fr;
        position: relative;
    }

    .sidebar-left,
    .sidebar-right {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 999;
        overflow-y: auto;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
        padding: 4rem 1rem 1rem;
    }

    .sidebar-right {
        left: auto;
        right: -300px;
        transition: right 0.3s ease-in-out;
        box-shadow: -2px 0 5px rgba(0,0,0,0.2);
    }

    .sidebar-left.active {
        left: 0;
    }

    .sidebar-right.active {
        right: 0;
    }

    .center-content {
        width: 100%;
    }

    .email-links,
    .shopping-links {
        justify-content: center;
    }

    .metals-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.3rem;
        padding-right: 3rem;
    }

    .search-input {
        padding: 8px 12px;
    }

    .search-button {
        padding: 8px 15px;
    }

    .section-title {
        font-size: 1rem;
    }

    .email-link,
    .shopping-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .sidebar-left,
    .sidebar-right,
    .site-footer {
        display: none;
    }

    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Hurricane Watch Image Styling */
.hurricane-image {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000; /* Optional: adds black background while loading */
    min-height: 280px; /* Gives it some height while loading */
}

.hurricane-image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* Optional: Add a subtle border to match video players */
.hurricane-image img {
    border: 1px solid #444;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Match video player width on larger screens */
@media (min-width: 1024px) {
    .hurricane-image img {
        max-width: 560px; /* Adjust this value to match your video players */
        width: 100%;
        margin: 0 auto;
    }
}