/* TIDE — Custom Styles
   Ocean Tide Partners
   Dark theme with teal/pink accents */

/* -- Base ------------------------------------------------- */
:root {
    --tide-dark: #0a0e1a;
    --tide-darker: #060911;
    --tide-card: #111827;
    --tide-border: #1e293b;
    --tide-teal: #4a9eb5;
    --tide-pink: #e3aab8;
}

::selection {
    background: rgba(74, 158, 181, 0.3);
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--tide-darker); }
::-webkit-scrollbar-thumb { background: var(--tide-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* Always-visible scrollbars on data containers */
.overflow-auto { scrollbar-gutter: stable; }
.overflow-auto::-webkit-scrollbar { width: 8px; height: 8px; }
.overflow-auto::-webkit-scrollbar-track { background: rgba(30, 41, 59, 0.5); border-radius: 4px; }
.overflow-auto::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; min-height: 40px; }
.overflow-auto::-webkit-scrollbar-thumb:hover { background: #64748b; }
.overflow-auto::-webkit-scrollbar-corner { background: rgba(30, 41, 59, 0.5); }

/* -- Cards ------------------------------------------------ */
.tide-card {
    background: var(--tide-card);
    border: 1px solid var(--tide-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
}
.tide-card-hover {
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tide-card-hover:hover {
    border-color: var(--tide-teal);
    box-shadow: 0 0 0 1px rgba(74, 158, 181, 0.15);
}

/* -- Stat Cards ------------------------------------------- */
.stat-card {
    background: var(--tide-card);
    border: 1px solid var(--tide-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}
.stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* -- Tables ----------------------------------------------- */
.tide-table { width: 100%; border-collapse: collapse; }
.tide-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid var(--tide-border);
    white-space: nowrap;
    background: var(--tide-card);
}
.tide-table thead.sticky th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--tide-card);
    box-shadow: 0 1px 0 0 var(--tide-border);
}
.tide-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}
.tide-table tbody tr:hover { background: rgba(74, 158, 181, 0.04); }
.tide-table tbody tr:last-child td { border-bottom: none; }

/* -- Forms ------------------------------------------------ */
.tide-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--tide-border);
    border-radius: 0.5rem;
    color: #e2e8f0;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tide-input:focus {
    outline: none;
    border-color: var(--tide-teal);
    box-shadow: 0 0 0 2px rgba(74, 158, 181, 0.2);
}
.tide-input::placeholder { color: #475569; }
.tide-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}
.tide-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 0.375rem;
}

/* -- Buttons ---------------------------------------------- */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--tide-teal); color: #fff;
    font-size: 0.875rem; font-weight: 500;
    border-radius: 0.5rem; border: none; cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: #3d8a9e; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent; color: #94a3b8;
    font-size: 0.875rem; font-weight: 500;
    border-radius: 0.5rem; border: 1px solid var(--tide-border); cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }

.btn-danger {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #dc2626; color: #fff;
    font-size: 0.875rem; font-weight: 500;
    border-radius: 0.5rem; border: none; cursor: pointer;
    transition: background 0.2s;
}
.btn-danger:hover { background: #b91c1c; }

/* -- Activity Feed ---------------------------------------- */
.activity-item {
    display: flex; gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
    width: 0.5rem; height: 0.5rem;
    border-radius: 50%; margin-top: 0.375rem; flex-shrink: 0;
}

/* -- Charts ----------------------------------------------- */
.chart-container { position: relative; width: 100%; }

/* -- Animations ------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease-out forwards; }

@keyframes pulse-teal {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 158, 181, 0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(74, 158, 181, 0); }
}
.pulse-teal { animation: pulse-teal 2s infinite; }

/* -- Responsive ------------------------------------------- */
@media (max-width: 640px) {
    .stat-value { font-size: 1.5rem; }
    .tide-table { font-size: 0.8125rem; }
}

/* -- App Shell -------------------------------------------- */
html, body {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
}

/* Prevent horizontal scrollbar globally */
*, *::before, *::after {
    max-width: 100%;
}
table, pre, code { max-width: none; }

/* Main scrollable area */
main.overflow-y-auto {
    -webkit-overflow-scrolling: touch;
}
