/* ===== Samudra — Dark Ocean Theme ===== */

:root {
    --bg: #0a0a16;
    --bg-surface: #0d0d1f;
    --bg-card: #111128;
    --bg-card-hover: #151535;
    --border: rgba(0, 212, 170, 0.10);
    --border-active: rgba(0, 212, 170, 0.25);
    --text: #e2e8f0;
    --text-muted: #8899aa;
    --text-dim: #556677;
    --accent: #00d4aa;
    --accent-blue: #0ea5e9;
    --accent-glow: rgba(0, 212, 170, 0.20);
    --danger: #ef4444;
    --warning: #f59e0b;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --max-w: 900px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Ocean Background Waves ===== */

.ocean-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    min-width: 1440px;
    height: 320px;
}

.wave-1 {
    animation: wave-drift 20s ease-in-out infinite;
    opacity: 0.6;
}

.wave-2 {
    animation: wave-drift 25s ease-in-out infinite reverse;
    opacity: 0.4;
}

@keyframes wave-drift {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-48%) translateY(-15px); }
}

/* ===== Header ===== */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 22, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-icon { font-size: 1.5rem; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--text); }

/* ===== Main ===== */

.main {
    position: relative;
    z-index: 1;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Hero ===== */

.hero {
    text-align: center;
    padding: 60px 0 32px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== Input Section ===== */

.input-section {
    margin-bottom: 40px;
}

.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.input-row {
    display: flex;
    gap: 10px;
}

.coord-input {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.coord-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.coord-input::placeholder {
    color: var(--text-dim);
}

.input-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.input-divider::before,
.input-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.input-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.875rem;
}

/* ===== Buttons ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #00b894);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.25);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 28px rgba(0, 212, 170, 0.40);
    transform: translateY(-1px);
}

.btn-secondary {
    width: 100%;
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.btn-ghost {
    background: transparent;
    color: var(--accent);
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-ghost:hover { background: var(--accent-glow); }

/* ===== Spinner ===== */

.spinner {
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

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

/* ===== Results ===== */

.results {
    margin-bottom: 48px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    text-align: center;
    margin-bottom: 24px;
}

.result-location {
    font-size: 1.3rem;
    font-weight: 700;
}

.result-coords {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Weather Card ===== */

.weather-card,
.prediction-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.weather-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weather-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.weather-value {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--accent-blue);
}

/* ===== Prediction Table ===== */

.prediction-table-wrap {
    overflow-x: auto;
    margin: 0 -4px;
}

.prediction-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.925rem;
}

.prediction-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--border);
}

.prediction-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.prediction-table tbody tr {
    transition: background 0.15s;
}

.prediction-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.prediction-table tbody tr:last-child td {
    border-bottom: none;
}

.animal-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.animal-emoji { font-size: 1.4rem; }

.stars {
    color: #fbbf24;
    font-size: 0.85rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

.reason-cell {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ===== Insight ===== */

.prediction-insight {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(0, 212, 170, 0.06);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Land warning (inside prediction-insight) */
.land-warning {
    padding: 0;
    background: none;
    border-left: none;
}

.land-warning code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 170, 50, 0.15);
    color: #ffaa32;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.land-warning p:first-child {
    margin-top: 0;
}

.land-warning ul {
    opacity: 0.85;
}

/* ===== Share ===== */

.share-section {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 8px;
}

.share-confirm {
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
}

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

/* ===== Info Section ===== */

.info-section {
    padding: 48px 0 60px;
}

.info-section h2 {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 32px;
    color: var(--text);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.2s;
}

.info-card:hover {
    border-color: var(--border-active);
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.info-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.info-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== Footer ===== */

.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 32px 20px;
    text-align: center;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 700;
    margin-bottom: 8px;
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.footer-desc a {
    color: var(--text-muted);
    text-decoration: underline;
}

.footer-desc a:hover { color: var(--text); }

.footer-links {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
}

.footer-links a:hover { color: var(--text-muted); }

.dot {
    margin: 0 8px;
    color: var(--text-dim);
}

/* ===== Responsive ===== */

/* Tablet (480px - 1024px) */
@media (max-width: 1024px) {
    .hero-title { font-size: 2rem; }
    .weather-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Phone (<480px) */
@media (max-width: 480px) {
    .hero { padding: 40px 0 24px; }
    .hero-title { font-size: 1.6rem; }
    .hero-sub { font-size: 0.95rem; }

    .input-card { padding: 20px; }
    .input-row { flex-direction: column; }
    .btn-primary { width: 100%; }

    .weather-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }

    .prediction-table {
        font-size: 0.8rem;
    }

    .prediction-table th,
    .prediction-table td {
        padding: 8px;
    }

    .animal-cell { font-size: 0.85rem; }

    .logo-text { display: none; }

    .land-warning { padding: 16px; font-size: 0.9rem; }
    .land-warning li { font-size: 0.8rem; }
}
