/* MIZ Working Group - Modern Stylesheet */

/* CSS Variables for consistent theming */
:root {
    --primary-blue: #1a3abc;
    --accent-blue: #70B7DD;
    --deep-blue: #0d1f5c;
    --light-blue: #e8f4fc;
    --ice-blue: #f0f8ff;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 12px;
}

/* Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--ice-blue);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--deep-blue);
    line-height: 1.3;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 600; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; font-weight: 600; }

p {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--deep-blue) 0%, var(--primary-blue) 100%);
    color: var(--white);
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../sea_ice_background_Strip.jpeg');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: 0;
}

header .header-content {
    position: relative;
    z-index: 1;
}

header h1 {
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

header .tagline {
    color: var(--light-blue);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Navigation */
nav {
    background: var(--accent-blue);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

nav ul li a {
    display: block;
    color: var(--white);
    padding: 1rem 1.5rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

nav ul li a:hover,
nav ul li a.active {
    background: var(--primary-blue);
    text-decoration: none;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--white);
    transition: var(--transition);
    transform: translateX(-50%);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 80%;
}

/* Main Content */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Cards/Sections */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card h2 {
    color: var(--primary-blue);
    border-bottom: 3px solid var(--accent-blue);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Feature Card (highlighted) */
.card.feature {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--white) 100%);
    border-left: 5px solid var(--primary-blue);
}

/* Alert/Highlight Card */
.card.highlight {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--primary-blue) 100%);
    color: var(--white);
}

.card.highlight h2,
.card.highlight p,
.card.highlight a {
    color: var(--white);
}

.card.highlight a:hover {
    color: var(--light-blue);
}

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

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

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

/* Flex utilities */
.flex-row {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.flex-row .content {
    flex: 1;
}

.flex-row .sidebar {
    flex-shrink: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--deep-blue);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
}

/* Countdown */
.countdown {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-align: center;
    padding: 1rem;
    background: var(--light-blue);
    border-radius: 8px;
    margin: 1rem 0;
}

/* Timeline/List styling */
.timeline {
    list-style: none;
    padding-left: 0;
}

.timeline li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    border-left: 2px solid var(--accent-blue);
    padding-bottom: 1rem;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--primary-blue);
    border-radius: 50%;
}

.timeline li:last-child {
    border-left: none;
}

/* Logo styling */
.logo-container {
    text-align: center;
}

.logo-container img {
    max-width: 150px;
    height: auto;
    transition: var(--transition);
}

.logo-container img:hover {
    transform: scale(1.05);
}

/* Footer */
footer {
    background: var(--deep-blue);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

footer a {
    color: var(--accent-blue);
}

footer a:hover {
    color: var(--white);
}

footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--light-blue);
}

table th {
    background: var(--primary-blue);
    color: var(--white);
}

table tr:nth-child(even) {
    background: var(--ice-blue);
}

table tr:hover {
    background: var(--light-blue);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-upcoming {
    background: var(--accent-blue);
    color: var(--white);
}

.badge-past {
    background: var(--text-light);
    color: var(--white);
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    nav ul {
        flex-direction: column;
        align-items: stretch;
    }

    nav ul li a {
        text-align: center;
        padding: 0.75rem 1rem;
    }

    main {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .flex-row {
        flex-direction: column;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .countdown {
        font-size: 1.2rem;
    }

    .btn {
        display: block;
        text-align: center;
        margin-bottom: 0.5rem;
    }
}

/* Animation utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Icon placeholders (if using icons later) */
.icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Polar Sidebar Widget */
.polar-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.polar-sidebar.collapsed .polar-sidebar-content {
    width: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.polar-sidebar.collapsed .polar-sidebar-toggle {
    border-radius: 8px 0 0 8px;
}

.polar-sidebar-toggle {
    background: var(--primary-blue);
    color: var(--white);
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    writing-mode: vertical-rl;
}

.polar-sidebar-toggle:hover {
    background: var(--deep-blue);
}

.polar-sidebar-content {
    background: var(--white);
    border-radius: 8px 0 0 8px;
    box-shadow: var(--shadow-hover);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition);
    max-width: 120px;
}

.polar-mini {
    background: var(--ice-blue);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    cursor: default;
    transition: var(--transition);
}

.polar-mini:hover {
    background: var(--light-blue);
}

.polar-mini.antarctic {
    border-left: 3px solid #4a90d9;
}

.polar-mini.arctic {
    border-left: 3px solid #7fbf7f;
}

.polar-mini-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.polar-mini-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--deep-blue);
    margin: 0.2rem 0;
}

.polar-mini-season {
    font-size: 0.7rem;
    color: var(--text-light);
}

.polar-mini-temp {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.polar-mini-clock {
    font-size: 0.75rem;
    color: var(--text-light);
    font-family: monospace;
    margin-top: 0.2rem;
}

/* Ice chart thumbnails */
.polar-mini.ice-chart {
    padding: 0.3rem;
    text-decoration: none;
    display: block;
}

.polar-mini.ice-chart img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: var(--transition);
}

.polar-mini.ice-chart:hover img {
    transform: scale(1.05);
}

.polar-mini.ice-chart span {
    display: block;
    font-size: 0.6rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* Hide sidebar on mobile */
@media (max-width: 768px) {
    .polar-sidebar {
        display: none;
    }
}
