/* ========================================
   TINY SEA SIMULATION STYLESHEET
   ======================================== */

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

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

/* ========================================
   HEADER STYLES
   ======================================== */

header {
    background: linear-gradient(135deg, #0a4d68 0%, #088395 50%, #05BFDB 100%);
    height: 85px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .wave-animation {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 30" preserveAspectRatio="none"><path d="M0,20 C300,30 600,10 900,20 C1050,25 1200,15 1200,15 L1200,30 L0,30 Z" fill="%23f8f9fa" opacity="0.3"/></svg>');
    background-size: 1200px 30px;
    background-repeat: repeat-x;
    animation: wave 10s linear infinite;
    opacity: 0.3;
}

@keyframes wave {
    0% { background-position: 0 0; }
    100% { background-position: 1200px 0; }
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 55px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
    color: #ffffff;
}

.logo-main {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.logo-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

/* Navigation */
nav {
    display: flex;
    gap: 10px;
}

nav a {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #00d9ff;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 70%;
}

nav a.active {
    background: rgba(255, 255, 255, 0.15);
}

/* ========================================
   MAIN CONTENT STYLES
   ======================================== */

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ========================================
   UNITY SECTION
   ======================================== */

.unity-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.unity-container {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 500px;
    background: linear-gradient(180deg, #001524 0%, #003153 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

#unity-canvas {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

/* Fullscreen Controls */
.fullscreen-controls {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}

.fullscreen-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #088395 0%, #05BFDB 100%);
    border: none;
    border-radius: 25px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(8, 131, 149, 0.3);
}

.fullscreen-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 131, 149, 0.5);
}

.fullscreen-button:active {
    transform: translateY(0);
}

.fullscreen-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.fullscreen-button span {
    white-space: nowrap;
}

#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 21, 36, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #00d9ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-overlay p {
    color: #b8e6f0;
    font-size: 18px;
    font-weight: 600;
}

.progress-bar {
    width: 250px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00d9ff 0%, #088395 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

/* Info Card */
.info-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #088395;
}

.info-card h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #0a4d68;
    margin-bottom: 15px;
}

.info-card p {
    margin-bottom: 20px;
    line-height: 1.7;
}

.btn-primary {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #088395 0%, #05BFDB 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(8, 131, 149, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 131, 149, 0.4);
}

/* ========================================
   ABOUT PAGE STYLES
   ======================================== */

.about-page {
    max-width: 1000px;
    margin: 0 auto;
}

.page-hero {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.page-hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: #0a4d68;
    margin-bottom: 15px;
}

.page-hero .subtitle {
    font-size: 18px;
    color: #088395;
    font-weight: 600;
}

.content-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #088395;
    margin-bottom: 40px;
}

.card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.card h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #0a4d68;
    margin-bottom: 15px;
}

.card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #088395;
    margin-top: 25px;
    margin-bottom: 10px;
}

.card p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.card ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.card li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.card li strong {
    color: #088395;
}

/* Visual Diagram Container */
.visual-diagram {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
}

/* Formula Display */
.formula-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 35px 25px;
    border-radius: 12px;
    margin: 25px 0;
}

.formula-title {
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.formula-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 18px;
}

.eq-label {
    font-weight: 700;
    color: #ffffff;
    margin-right: 10px;
    font-size: 20px;
}

.eq-comp {
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.eq-comp.eq-base { background: #3498db; }
.eq-comp.eq-seasonal { background: #9b59b6; }
.eq-comp.eq-climate { background: #e74c3c; }
.eq-comp.eq-interannual { background: #f39c12; }
.eq-comp.eq-daily { background: #1abc9c; }

.eq-plus {
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
}

/* Temperature Grid */
.temp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.temp-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 10px;
}

.temp-icon {
    min-width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
}

.temp-details strong {
    display: block;
    font-size: 15px;
    color: #0a4d68;
    margin-bottom: 6px;
}

.temp-details p {
    font-size: 13px;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.5;
}

/* Info Note */
.info-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 15px;
    color: #856404;
}

/* Biology Flowchart */
.bio-flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 35px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
}

.bio-step {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #ffffff;
    padding: 20px 25px;
    border-radius: 10px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.step-num {
    min-width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #088395 0%, #05BFDB 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    font-family: 'Montserrat', sans-serif;
}

.step-info {
    flex: 1;
}

.step-info strong {
    display: block;
    color: #0a4d68;
    font-size: 17px;
    margin-bottom: 6px;
    font-family: 'Montserrat', sans-serif;
}

.step-info p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

.step-arrow {
    font-size: 32px;
    color: #088395;
    font-weight: bold;
    text-align: center;
}

/* Accumulator Grid */
.accum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.accum-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    border-top: 4px solid #088395;
}

.accum-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

.accum-box h3 {
    text-align: center;
    color: #0a4d68;
    font-size: 18px;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
}

.accum-calc {
    background: #ffffff;
    padding: 18px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 15px;
}

.calc-line {
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
    color: #7f8c8d;
}

.calc-line:last-of-type {
    border-bottom: none;
}

.calc-dots {
    text-align: center;
    color: #7f8c8d;
    padding: 5px 0;
}

.calc-result {
    margin-top: 12px;
    padding: 12px;
    background: #d4f1f4;
    border-radius: 6px;
    color: #0a4d68;
    font-weight: 600;
    text-align: center;
}

.calc-note {
    margin-top: 10px;
    font-style: italic;
    color: #e74c3c;
    text-align: center;
    font-size: 12px;
}

.accum-why {
    font-size: 13px;
    color: #088395;
    font-style: italic;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

/* Rationale Box */
.rationale-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.rationale-box strong {
    display: block;
    color: #0a4d68;
    font-size: 16px;
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}

.rationale-box p {
    color: #2c3e50;
    line-height: 1.7;
    margin: 0;
}

/* Feedback Grid */
.feedback-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin-top: 30px;
}

.feedback-box {
    background: #ffffff;
    padding: 22px;
    border-radius: 12px;
    border-left: 4px solid #088395;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.feedback-header {
    font-size: 16px;
    font-weight: 600;
    color: #0a4d68;
    margin-bottom: 18px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.feedback-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.chain-node {
    background: #088395;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.chain-arrow {
    color: #088395;
    font-size: 18px;
    font-weight: bold;
}

.feedback-detail {
    text-align: center;
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.feedback-why {
    font-size: 13px;
    color: #088395;
    font-style: italic;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* Example Highlight */
.example-highlight {
    background: #f8f9fa;
    padding: 22px;
    border-radius: 10px;
    border-left: 4px solid #088395;
    margin-top: 25px;
}

.example-highlight strong {
    display: block;
    color: #0a4d68;
    margin-bottom: 12px;
    font-size: 16px;
}

.example-highlight ul {
    margin: 12px 0 0 0;
}

.example-highlight li {
    margin-bottom: 12px;
}

/* Evolution Grid */
.evolution-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.evolution-step {
    background: #ffffff;
    padding: 18px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.evolution-label {
    font-weight: 600;
    color: #e74c3c;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}

.evolution-step p {
    margin: 0;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.6;
}

.evolution-arrow {
    font-size: 28px;
    color: #088395;
    font-weight: bold;
}

/* ========================================
   FOOTER STYLES
   ======================================== */

footer {
    background: linear-gradient(135deg, #0a4d68 0%, #088395 100%);
    color: #ffffff;
    margin-top: 60px;
    position: relative;
}

footer .wave-animation-footer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 30" preserveAspectRatio="none"><path d="M0,15 C300,5 600,25 900,15 C1050,10 1200,20 1200,20 L1200,0 L0,0 Z" fill="%23667eea" opacity="0.5"/></svg>');
    background-size: 1200px 30px;
    background-repeat: repeat-x;
    animation: wave-reverse 8s linear infinite;
    opacity: 0.5;
}

@keyframes wave-reverse {
    0% { background-position: 0 0; }
    100% { background-position: -1200px 0; }
}

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

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer-section h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.footer-section p {
    color: #b8e6f0;
    line-height: 1.6;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #b8e6f0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #00d9ff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: #b8e6f0;
    font-size: 14px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    header {
        height: auto;
        padding: 15px 0;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo img {
        height: 50px;
    }
    
    .logo-main {
        font-size: 20px;
    }
    
    .logo-subtitle {
        font-size: 11px;
    }
    
    nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav a {
        font-size: 13px;
    }
    
    .unity-container {
        height: 400px;
        min-height: 400px;
    }
    
    .fullscreen-button {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .fullscreen-button svg {
        width: 18px;
        height: 18px;
    }
    
    .page-hero h1 {
        font-size: 32px;
    }
    
    .card {
        padding: 20px;
    }
    
    .formula-equation {
        font-size: 14px;
        gap: 8px;
    }
    
    .eq-comp {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .temp-grid {
        grid-template-columns: 1fr;
    }
    
    .bio-flowchart {
        padding: 20px 15px;
    }
    
    .bio-step {
        padding: 16px 18px;
    }
    
    .step-num {
        min-width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .accum-grid,
    .feedback-grid {
        grid-template-columns: 1fr;
    }
    
    .evolution-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .evolution-arrow {
        transform: rotate(90deg);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 45px;
    }
    
    .logo-main {
        font-size: 18px;
    }
    
    nav a {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .fullscreen-button span {
        display: none;
    }
    
    .fullscreen-button {
        padding: 10px;
    }
    
    .page-hero h1 {
        font-size: 28px;
    }
    
    .card h2 {
        font-size: 20px;
    }
    
    .card-icon {
        font-size: 36px;
    }
}