/* Fantasy CEO Main Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f5f5f5;
}

/* Navigation */
.fantasy-ceo-nav {
    background: #1a1a1a;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body.admin-bar .fantasy-ceo-nav {
    top: 32px;
}

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

.nav-logo a {
    color: #fff;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    /* Flex so the parachute logo image and "Fantasy CEO" wordmark sit
       side-by-side and vertically centered. The link itself is the flex
       container so the whole thing is one click target. */
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-logo-img {
    display: block;
    width: 32px;
    height: 32px;
    /* Subtle drop-shadow gives the logo dimension against the dark nav
       background. Soft and small — just enough to lift off the surface. */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.nav-logo-text {
    line-height: 1; /* prevents the text from looking baseline-misaligned next to the image */
}

.nav-menu {
    display: flex;
    gap: 25px;
    align-items: center;
}

/* Hamburger button — hidden by default (desktop). Shown only at the
   ≤768px breakpoint where the inline menu doesn't fit. Three short
   bars form the ☰ icon; when .is-open is set on the nav root, the
   bars rotate into an ✕ for a clear close signal. */
.nav-hamburger {
    display: none;
    background: transparent;
    border: 0;
    padding: 8px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.nav-hamburger:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
    border-radius: 4px;
}
.nav-hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
/* When the menu is open, transform the bars into a clean ✕.
   Middle bar fades; top and bottom rotate into a cross. */
.fantasy-ceo-nav.is-open .nav-hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.fantasy-ceo-nav.is-open .nav-hamburger-line:nth-child(2) {
    opacity: 0;
}
.fantasy-ceo-nav.is-open .nav-hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #FFD700;
}

.nav-user {
    color: #FFD700;
    font-weight: 600;
}

.nav-logout {
    color: #f44336 !important;
}

/* Hero for logged-out users */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), 
                url('../images/boardroom-hero.png') center/cover no-repeat;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}

.hero-content {
    max-width: 800px;
    padding: 40px 20px;
    z-index: 2;
}

.hero h1 {
    font-size: 56px;
    margin-bottom: 20px;
    font-weight: 800;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    color: #fff !important;
}

.hero p {
    font-size: 24px;
    margin-bottom: 40px;
    opacity: 0.95;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

/* Footer */
.fantasy-ceo-footer {
    background: #1a1a1a;
    color: #fff;
    padding: 60px 20px 20px 20px;
    margin-top: 80px;
}

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

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: #FFD700;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 700;
}

.footer-section p {
    color: #999;
    font-size: 14px;
    line-height: 1.6;
}

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

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

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

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

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* Card Container */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Buttons */
.button {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.button:hover {
    background: #005177;
    transform: translateY(-2px);
}

.button.primary {
    background: #4CAF50;
}

.button.primary:hover {
    background: #45a049;
}

.button.secondary {
    background: #666;
}

.button.secondary:hover {
    background: #555;
}

.button.large {
    padding: 15px 40px;
    font-size: 18px;
}

/* Forms */
.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1a1a1a;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #0073aa;
}

/* Messages */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #c62828;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2e7d32;
}

.info-message {
    background: #e3f2fd;
    color: #1565c0;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #1565c0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

table tr:hover {
    background: #f9f9f9;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* CEO Tooltip System */
.ceo-link-wrapper {
    position: relative;
    display: inline-block;
}

.ceo-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.ceo-link:hover {
    text-decoration: underline;
}

.ceo-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    padding: 20px;
    min-width: 280px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    border: 2px solid #0073aa;
}

.ceo-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #0073aa;
}

.ceo-link-wrapper:hover .ceo-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
    pointer-events: auto;
}

.ceo-tooltip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.ceo-tooltip-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}

.ceo-tooltip-info h4 {
    margin: 0 0 3px 0;
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 600;
}

.ceo-tooltip-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.ceo-tooltip-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.ceo-tooltip-stat {
    flex: 1;
    text-align: center;
}

.ceo-tooltip-stat-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.ceo-tooltip-stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
}

.ceo-tooltip-link {
    display: block;
    text-align: center;
    padding: 8px 12px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.ceo-tooltip-link:hover {
    background: #005177;
    text-decoration: none;
}

/* Responsive hero and footer */
@media (max-width: 768px) {
    .hero {
        min-height: 50vh;
    }
    
    .hero h1 {
        font-size: 36px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 30px;
    }
    
    .footer-section h4 {
        font-size: 16px;
    }
    
    .footer-section ul li a,
    .footer-section p {
        font-size: 13px;
    }
    
    .ceo-tooltip {
        display: none !important;
    }
    
    /* === Mobile nav: hamburger + dropdown panel === */

    /* Show the hamburger button */
    .nav-hamburger {
        display: flex;
    }

    /* Collapse the inline menu into a full-width panel that slides
       down from below the header. Hidden by default; revealed when
       the parent has .is-open. Using max-height for the transition
       avoids layout thrash and works for any number of links. */
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a1a1a; /* matches .fantasy-ceo-nav background */
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 20px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease, padding 0.25s ease;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    }
    .fantasy-ceo-nav.is-open .nav-menu {
        max-height: 80vh;
        padding: 12px 20px 16px 20px;
        overflow-y: auto;
    }

    /* Each link becomes a full-row tap target with comfortable
       touch height (44px is Apple's HIG minimum). */
    .nav-menu a,
    .nav-menu .nav-user {
        display: block;
        padding: 12px 4px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav-menu a:last-child,
    .nav-menu .nav-user:last-child {
        border-bottom: 0;
    }

    /* Position context for the absolute-positioned panel */
    .fantasy-ceo-nav {
        position: relative;
    }
    .nav-container {
        position: relative;
    }

    /* On mobile, the nav bar is tight — shrink the logo image and
       lighten the gap so we don't push nav links off the screen.
       Wordmark stays visible (it's the actual brand). */
    .nav-logo a {
        font-size: 18px;
        gap: 7px;
    }
    .nav-logo-img {
        width: 26px;
        height: 26px;
    }
    
    .card {
        padding: 20px;
        margin: 10px;
    }
}

/* Responsive Tables */
@media (max-width: 768px) {
    table {
        font-size: 14px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.hidden {
    display: none;
}

/* Page Containers */
.fantasy-ceo-create-league,
.fantasy-ceo-join-league,
.fantasy-ceo-league,
.fantasy-ceo-team,
.fantasy-ceo-draft,
.fantasy-ceo-rankings,
.fantasy-ceo-dashboard,
.fantasy-ceo-queue,
.fantasy-ceo-detail,
.fantasy-ceo-draft-results {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Print Styles */
@media print {
    .fantasy-ceo-nav,
    .fantasy-ceo-footer,
    .button,
    .back-link {
        display: none;
    }
}