/* src/public/css/main.css */

@import './animations.css';
@import './mobile-menu.css';
@import './settings.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --apple-blue: #007AFF;
  --apple-green: #34C759;
  --warning-red: #FF3B30;
  --light-gray: #F2F2F7;
  --medium-gray: #E5E5EA;
  --dark-gray: #8A8A8E;
  --pure-black: #000000;
  --pure-white: #FFFFFF;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --highlight-blue: #F0F7FF;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, -ui-sans-serif, sans-serif;
  background-color: var(--light-gray);
  color: var(--pure-black);
}

/* --- MODERN APPLE "DYNAMIC ISLAND" STYLE TOASTS --- */
#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000; /* Top of everything */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: auto;
    pointer-events: none; /* Allow clicks to pass through the container area */
}

.toast-apple {
    pointer-events: auto;
    background: rgba(20, 20, 20, 0.90); /* Deep dark grey/black */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    padding: 10px 20px 10px 14px; /* Compact pill padding */
    border-radius: 50px; /* Perfect pill shape */
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1); /* Subtle border */
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    width: max-content; /* Only as wide as needed */
    max-width: 85vw; /* Prevent overflow on mobile */
    
    /* Animation State: Hidden */
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy Spring */
}

.toast-apple.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-apple.hide {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s ease-in;
}

/* Icon Circle */
.toast-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 16px;
}

/* Status Colors */
.toast-success .toast-icon-box { background: #34C759; color: white; }
.toast-error .toast-icon-box { background: #FF3B30; color: white; }
.toast-info .toast-icon-box { background: #007AFF; color: white; }

/* Text Styling */
.toast-message {
    line-height: 1.4;
}

/* --- EXISTING STYLES --- */
.card, .main-card, .stat-card {
  background-color: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 4px 12px var(--shadow-color);
  border: 1px solid var(--medium-gray);
}
.h1-gradient {
  background: linear-gradient(180deg, #333333 0%, #000000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}
.success-text { color: var(--apple-green); }
.failure-text { color: var(--warning-red); }
.nav-link.active { background-color: var(--highlight-blue); color: var(--apple-blue); }
#settings-popover {
  position: absolute; top: 110%; right: 0; min-width: 220px; padding: 12px 14px 10px;
  border-radius: 18px; background-color: #ffffff;
  border: 1px solid rgba(229, 229, 234, 0.9);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  opacity: 0; transform: translateY(-4px); pointer-events: none; visibility: hidden;
}
#settings-popover.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; visibility: visible; }
.segmented-control { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 3px; border-radius: 999px; background-color: #f3f4f6; }
.segmented-control button { flex: 1 1 auto; padding: 5px 10px; border-radius: 999px; border: none; font-size: 11px; font-weight: 600; color: #6b7280; background-color: transparent; cursor: pointer; }
.segmented-control button.is-active, .segmented-control button.active { background-color: #ffffff; color: var(--apple-blue); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.leaderboard-card { background-color: #ffffff; border-radius: 0.75rem; box-shadow: 0 1px 3px var(--shadow-color); border: 1px solid var(--medium-gray); content-visibility: auto; contain-intrinsic-size: 110px; }
@media (min-width: 1024px) { .leaderboard-card { contain-intrinsic-size: 62px; } }
.score-badge { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.filter-card { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(12px); border: 1px solid rgba(229, 229, 234, 0.8); border-radius: 1.5rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); padding: 0.75rem; }
.filter-popover { position: absolute; top: 100%; margin-top: 0.5rem; background-color: #ffffff; border-radius: 1.5rem; border: 1px solid #e5e7eb; box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08); padding: 0; min-width: 16rem; opacity: 0; transform: scale(0.95); transform-origin: top; pointer-events: none; visibility: hidden; display: flex; flex-direction: column; }
.filter-popover.active { opacity: 1; transform: scale(1); pointer-events: auto; visibility: visible; }
.form-checkbox { height: 1rem; width: 1rem; border-radius: 0.25rem; border: 1px solid #d1d5db; color: var(--apple-blue); display: inline-block; vertical-align: middle; }
.date-range-btn { padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-size: 0.7rem; font-weight: 500; background-color: #f3f4f6; color: #4b5563; }
.picks-table th { background-color: #f9fafb; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; }
.picks-table td, .picks-table th { padding: 0.75rem 1rem; border-bottom: 1px solid var(--medium-gray); }
.status-badge { padding: 0.25rem 0.625rem; font-size: 0.7rem; font-weight: 600; border-radius: 999px; display: inline-flex; align-items: center; text-transform: capitalize; }
.status-win { background-color: #bbf7d0; color: #166534; }
.status-loss { background-color: #fee2e2; color: #b91c1c; }
.status-push { background-color: #e5e7eb; color: #374151; }
.pagination-button { display: inline-flex; align-items: center; justify-content: center; height: 2.25rem; width: 2.25rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; border: 1px solid #e5e7eb; background-color: #ffffff; color: #4b5563; }
.pagination-button.active { background-color: var(--apple-blue); color: #ffffff; border-color: var(--apple-blue); }
.breakdown-header { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; font-size: 0.75rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; padding-bottom: 0.25rem; border-bottom: 1px solid #e5e7eb; }
.breakdown-header span:not(:first-child) { text-align: right; }
.view-toggle-btn { border-radius: 999px; padding: 0.35rem 0.85rem; font-size: 0.75rem; font-weight: 500; color: #6b7280; background-color: #ffffff; border: 1px solid #e5e7eb; }
.table-container { transition: opacity 0.2s ease-in-out; }
nav a, .navigation-link { transition: all 0.2s; }
body:not(.admin-ready) [data-tools-nav="true"] { display: none !important; }
.app-loader { position: fixed; inset: 0; z-index: 9999; background-color: #f3f4f6; display: flex; align-items: center; justify-content: center; }
.app-loader .spinner { width: 40px; height: 40px; border-radius: 9999px; border: 3px solid #d1d5db; border-top-color: #111827; animation: app-loader-spin 0.6s linear infinite; }
@keyframes app-loader-spin { to { transform: rotate(360deg); } }
body.app-loading > *:not(#app-loader) { visibility: hidden !important; }
body:not(.app-loading) #app-loader { display: none; }
