/**
 * style.css - DRIFT Protocol — Shared Styles
 */

/* ─── FONTS ─────────────────────────────────────────── */
/* Loaded via <link> in each HTML, declared here for reference:
   Inter, Bungee Shade, Space Mono, Material Symbols Outlined */

/* ─── RESET & BASE ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg:          #ffffff;
    --bg-alt:      #f9fafb;
    --bg-gray:     #f3f4f6;
    --text:        #111111;
    --text-dim:    #6b7280;
    --border:      #e5e7eb;
    --border-alt:  #e5e5e5;
    --brand:       #135bec;
    --danger:      #ef4444;
    --mono:        "Space Mono", monospace;
    --sans:        "Inter", sans-serif;
    --ms-hour:     3600000;
}

body {
    font-family: var(--sans);
    background-color: var(--bg-gray);
    color: var(--text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────── */
.brand-logo {
    font-family: 'Bungee Shade', cursive;
}

.mono {
    font-family: var(--mono);
}

/* ─── NAV / AUTH TABS ────────────────────────────────── */
.tab-active {
    border-bottom: 2px solid #000;
    color: #000;
    font-weight: 900;
}

.tab-inactive {
    border-bottom: 2px solid transparent;
    color: #9ca3af;
}

/* ─── SCROLLBAR ──────────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ─── SECTOR FILTER TOOLTIPS ─────────────────────────── */
.sector-tooltip-container { position: relative; }

.sector-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 220px;
    background-color: #000;
    color: #fff;
    text-align: left;
    padding: 12px;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1.4;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 100;
    opacity: 0;
    transition: all 0.2s;
    pointer-events: none;
}

.sector-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
}

.sector-tooltip-container:hover .sector-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
    .sector-tooltip { display: none; }
}

/* ─── UPLOAD SELECT (centrato) ───────────────────────── */
#uploadSector {
    text-align: center;
    text-align-last: center;
    -moz-text-align-last: center;
    appearance: none;
    -webkit-appearance: none;
}

#uploadSector option {
    text-align: left;
}

/* ─── MOBILE: Prevent zoom on inputs ────────────────── */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ─── IMAGE DETAIL PAGE ──────────────────────────────── */
#display-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ─── RULES PAGES ────────────────────────────────────── */
.rules-body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-alt);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.rules-header a {
    text-decoration: none;
    color: inherit;
    font-weight: bold;
    transition: color 0.2s;
}

.rules-header a:hover { color: var(--brand); }

.lang-switch { margin-left: 15px; color: #999; }
.lang-active  { color: var(--text); }

.rules-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

.rules-hero {
    text-align: center;
    margin-bottom: 80px;
}

.rules-hero h1 {
    font-family: 'Bungee Shade', cursive;
    font-size: 40px;
    margin: 0 0 20px 0;
    line-height: 1;
}

.rules-subtitle {
    font-family: var(--mono);
    font-size: 12px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.rules-main section { margin-bottom: 100px; }

.rules-main h2 {
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border-bottom: 1px solid var(--text);
    padding-bottom: 10px;
    margin-bottom: 30px;
}

/* Timeline */
.timeline-wrapper { margin: 40px 0; }

.timeline-bar {
    display: flex;
    height: 50px;
    width: 100%;
    border: 2px solid var(--text);
    border-radius: 8px;
    overflow: hidden;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: bold;
}

.phase-early {
    width: 8.33%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 2px solid var(--text);
}

.phase-standard {
    width: 83.34%;
    background: #fff;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 2px solid var(--text);
}

.phase-late {
    width: 8.33%;
    background: #f3f4f6;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-labels {
    position: relative;
    margin-top: 10px;
    font-family: var(--mono);
    font-size: 10px;
    color: #666;
    height: 15px;
}

.time-labels span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Weight cards */
.weights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.weight-card {
    border: 1px solid var(--border-alt);
    border-radius: 12px;
    padding: 20px;
    background: #fafafa;
    transition: transform 0.2s;
}

.weight-card:hover {
    transform: translateY(-3px);
    border-color: var(--text);
}

.weight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-family: var(--mono);
    font-size: 10px;
    color: #666;
}

.multiplier {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: -0.05em;
}

.mul-high  { color: var(--brand); }
.mul-std   { color: var(--text); }
.mul-low   { color: #999; }

.weight-desc {
    font-size: 13px;
    line-height: 1.4;
    color: #666;
}

/* Rank grid */
.rank-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-step {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--border-alt);
    border-radius: 12px;
    background: #fff;
}

.rank-icon {
    font-size: 28px;
    flex-shrink: 0;
    filter: grayscale(1);
}

.rank-info    { flex: 1; }
.rank-title   { display: block; font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.rank-req     { font-family: var(--mono); font-size: 10px; color: #888; text-transform: uppercase; }

.rank-oracle     { border-left: 4px solid var(--brand); }
.rank-strategist { border-left: 4px solid var(--text); }
.rank-analyst    { border-left: 4px solid #666; }
.rank-observer   { border-left: 4px solid #ccc; background: #fafafa; }

/* Rules footer */
.rules-footer {
    padding: 40px;
    border-top: 1px solid var(--border-alt);
    text-align: center;
    font-family: var(--mono);
    font-size: 9px;
    color: #999;
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .rules-hero h1           { font-size: 28px; }
    .timeline-bar span       { font-size: 8px; }
}

/* ─── LEGAL PAGES (privacy, cookies) ─────────────────── */
.legal-body {
    font-family: var(--sans);
    background-color: var(--bg);
    color: var(--text);
    padding: 24px;
    max-width: 768px;
    margin: 0 auto;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

@media (min-width: 640px) {
    .legal-body { padding: 80px; }
}
