/* ============================================================
   RESET & BASE STYLES
   A universal reset removes default browser margin and padding
   so layout behaves consistently across all browsers.
   box-sizing: border-box makes padding and border included
   in an element's declared width/height - much easier to work
   with in grid and flex layouts.
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Default dark theme: black background, white bold text.
   The background-color here is a fallback - the actual color
   is overridden inline in page1.php using the value from sk.sk. */
body {
    background-color: #000000;
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-weight: bold;
    line-height: 1.6;
}


/* ============================================================
   GLOBAL LINK STYLES
   All links default to white to match the dark theme.
   Visited links also stay white so users can't tell which
   profiles they've clicked on before.
============================================================ */
a {
    color: #ffffff;
    font-weight: bold;
    text-decoration: underline;
}

a:hover {
    color: #cccccc;
}

a:visited {
    color: #ffffff;
}


/* ============================================================
   MAIN CONTENT CONTAINER
   Centers the page content and limits max width to 1200px
   so it doesn't stretch too wide on large monitors.
   Note: opacity starts at 0 in page1.php inline styles and
   is faded in via JavaScript to prevent FOUC (flash of
   unstyled content) while the page loads.
============================================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}


/* ============================================================
   GLOBAL IMAGE DEFAULTS
   Prevents images from overflowing their containers and
   ensures they never display inline (which adds unwanted
   whitespace below them in some browsers).
============================================================ */
img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ============================================================
   SITE BANNER
   The main banner.jpg at the top of the page. The rainbow
   pulse animation cycles through all 7 colors of the spectrum
   over 10 seconds using layered box-shadow and border-color.
   Hovering pauses the animation and slightly scales the image.
============================================================ */
.site-banner {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 3px solid #ff0000;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5),
                0 0 40px rgba(255, 0, 0, 0.3);
    transition: transform 0.3s ease;
    animation: rainbowPulse 10s linear infinite;
}

/* Rainbow animation keyframes - steps through ROY G BIV colors.
   Each stop animates both the border color and the matching
   glow (box-shadow) at three intensity layers. */
@keyframes rainbowPulse {
    0% {
        border-color: #ff0000;        /* Red */
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.5),
                    0 0 40px rgba(255, 0, 0, 0.3),
                    0 0 60px rgba(255, 0, 0, 0.2);
    }
    14% {
        border-color: #ff7f00;        /* Orange */
        box-shadow: 0 0 20px rgba(255, 127, 0, 0.5),
                    0 0 40px rgba(255, 127, 0, 0.3),
                    0 0 60px rgba(255, 127, 0, 0.2);
    }
    28% {
        border-color: #ffff00;        /* Yellow */
        box-shadow: 0 0 20px rgba(255, 255, 0, 0.5),
                    0 0 40px rgba(255, 255, 0, 0.3),
                    0 0 60px rgba(255, 255, 0, 0.2);
    }
    42% {
        border-color: #00ff00;        /* Green */
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.5),
                    0 0 40px rgba(0, 255, 0, 0.3),
                    0 0 60px rgba(0, 255, 0, 0.2);
    }
    57% {
        border-color: #0000ff;        /* Blue */
        box-shadow: 0 0 20px rgba(0, 0, 255, 0.5),
                    0 0 40px rgba(0, 0, 255, 0.3),
                    0 0 60px rgba(0, 0, 255, 0.2);
    }
    71% {
        border-color: #4b0082;        /* Indigo */
        box-shadow: 0 0 20px rgba(75, 0, 130, 0.5),
                    0 0 40px rgba(75, 0, 130, 0.3),
                    0 0 60px rgba(75, 0, 130, 0.2);
    }
    85% {
        border-color: #9400d3;        /* Violet */
        box-shadow: 0 0 20px rgba(148, 0, 211, 0.5),
                    0 0 40px rgba(148, 0, 211, 0.3),
                    0 0 60px rgba(148, 0, 211, 0.2);
    }
    100% {
        border-color: #ff0000;        /* Back to Red - seamless loop */
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.5),
                    0 0 40px rgba(255, 0, 0, 0.3),
                    0 0 60px rgba(255, 0, 0, 0.2);
    }
}

/* Pausing the animation on hover lets users get a clear look
   at the banner without the colors distracting them. */
.site-banner:hover {
    transform: scale(1.02);
    animation-play-state: paused;
}


/* ============================================================
   IMAGE UTILITY CLASSES
   Reusable helpers for common image layout patterns.
   .responsive-img: full-width image that scales with container
   .img-container: wrapper that crops overflowing images cleanly
============================================================ */
.responsive-img {
    width: 100%;
    height: auto;
    display: block;
}

.img-container {
    width: 100%;
    overflow: hidden;
}

/* object-fit: cover fills the container without distorting
   the image - crops the edges rather than squishing it */
.img-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
}


/* ============================================================
   FLEX LAYOUT UTILITIES
   General-purpose flexbox wrapper. flex-wrap allows items to
   wrap to the next line when they run out of space.
   flex-item uses "flex: 1 1 300px" meaning each item can grow
   and shrink but starts at 300px wide.
============================================================ */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.flex-item {
    flex: 1 1 300px;
}


/* ============================================================
   CSS GRID LAYOUT SYSTEM
   A set of reusable grid classes for building column layouts.
   All grid containers share the base .grid-container class
   and are combined with a column modifier class.

   Profile cards use .grid-auto-fit which is fixed at 4 columns
   on desktop. Fixed columns (not auto-fit/auto-fill) are used
   for the profile grid to ensure perfectly even distribution -
   auto-fit can produce uneven rows when card content varies.
============================================================ */
.grid-container {
    display: grid;
    gap: 15px;       /* Spacing between grid cells */
}

/* Fixed column layouts */
.grid-2-col {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3-col {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4-col {
    grid-template-columns: repeat(4, 1fr);
}

/* Profile card grid - strict 4 columns, align-items: stretch
   ensures all wrappers fill their grid cell height equally */
.grid-auto-fit {
    grid-template-columns: repeat(4, 1fr);
    align-items: stretch;
}

/* Fluid grid - fills available space with as many columns as
   will fit at the minimum size. Less predictable than fixed
   columns but useful for variable-count content. */
.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Column spanning utilities - make a grid item span multiple columns */
.grid-span-2 {
    grid-column: span 2;
}

.grid-span-3 {
    grid-column: span 3;
}

.grid-span-4 {
    grid-column: span 4;
}

/* Row spanning utilities - make a grid item span multiple rows */
.grid-row-span-2 {
    grid-row: span 2;
}

.grid-row-span-3 {
    grid-row: span 3;
}

/* Sidebar layouts - fixed sidebar width with fluid content area */
.grid-sidebar-left {
    grid-template-columns: 250px 1fr;
}

.grid-sidebar-right {
    grid-template-columns: 1fr 250px;
}

/* Full page layout with sticky footer behavior */
.grid-header-content-footer {
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}


/* ============================================================
   BASE TYPOGRAPHY
   Default font sizes for headings and paragraphs at desktop
   width. These are reduced at tablet and mobile breakpoints.
============================================================ */
h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    font-size: 1rem;
    margin-bottom: 1rem;
}


/* ============================================================
   RESPONSIVE BREAKPOINTS
   Three breakpoints target tablet, mobile, and small mobile.
   Each reduces font sizes, padding, and grid column counts
   to keep the layout usable on smaller screens.
============================================================ */

/* --- Tablet (≤1024px): 3 profile card columns --- */
@media screen and (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    /* 4-column grids collapse to 2 on tablets */
    .grid-4-col {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Profile card grid reduces from 4 to 3 columns */
    .grid-auto-fit {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Sidebar gets a slightly narrower fixed column */
    .grid-sidebar-left,
    .grid-sidebar-right {
        grid-template-columns: 200px 1fr;
    }
}

/* --- Mobile (≤768px): 2 profile card columns --- */
@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    p  { font-size: 0.95rem; }
    
    .flex-container {
        gap: 10px;
    }
    
    /* Stack flex items vertically on mobile */
    .flex-item {
        flex: 1 1 100%;
    }
    
    /* Tighter gap between grid cells on smaller screens */
    .grid-container {
        gap: 10px;
    }
    
    /* Profile card grid reduces to 2 columns on mobile.
       align-items: start prevents cards from stretching to
       match the tallest card in a row. */
    .grid-auto-fit {
        grid-template-columns: repeat(2, 1fr);
        align-items: start;
    }
    
    /* All multi-column grids collapse to 2 on mobile */
    .grid-2-col,
    .grid-3-col,
    .grid-4-col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Sidebars become single-column stacked layouts */
    .grid-sidebar-left,
    .grid-sidebar-right {
        grid-template-columns: 1fr;
    }
    
    /* Spanning items no longer span multiple columns on mobile */
    .grid-span-2,
    .grid-span-3,
    .grid-span-4 {
        grid-column: span 1;
    }
    
    /* Slightly larger text in profile cards for readability */
    .profile-card {
        padding: 15px;
    }
    
    .profile-name {
        font-size: 1rem;
    }
    
    .profile-phone,
    .profile-status {
        font-size: 0.9rem;
    }
}

/* --- Small Mobile (≤480px): still 2 columns, tighter spacing --- */
@media screen and (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    p  { font-size: 0.9rem; }
    
    /* Tightest gap at smallest screen size */
    .grid-container {
        gap: 8px;
    }
    
    .profile-card {
        padding: 12px;
    }
    
    .profile-name {
        font-size: 0.95rem;
    }
    
    .profile-phone,
    .profile-status {
        font-size: 0.85rem;
    }
}


/* ============================================================
   PROFILE CARD SYSTEM
   Cards display agent headshots in a responsive grid.
   Default state: headshot + name only.
   Hover state: a semi-transparent overlay fades in over the
   card showing phone number, availability status, dispatch123
   status icon, and optional email/Discord contact links.

   There are two card wrapper types:
     .profile-card-wrapper  - available agents (green border)
     .profile-card-inactive - unavailable agents (red border, dimmed)

   Both wrappers are block-level and fill their grid cell with
   width/height 100% so the grid stays perfectly even.
============================================================ */

/* Wrapper for available agent cards */
.profile-card-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

/* Legacy wrapper class - kept for compatibility */
.profile-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

/* Inner link wrapping just the headshot and name on available cards */
.profile-card-img-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Wrapper for unavailable agent cards - cursor:default so it
   doesn't show a pointer (nothing to click on) */
.profile-card-inactive {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: default;
    width: 100%;
    height: 100%;
}

/* The card itself - position:relative is required so the
   absolutely-positioned hover overlay is contained within it.
   overflow:hidden clips the overlay to the card's border-radius. */
.profile-card {
    background-color: #1a1a1a;
    border: 2px solid #333333;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* Unavailable cards are dimmed to visually distinguish them
   from available cards at a glance */
.profile-card-inactive .profile-card {
    cursor: default;
    opacity: 0.7;
}

/* Available agent - green pulsing border and glow */
.profile-card.available {
    border-color: #00ff00;
    animation: greenPulse 2s ease-in-out infinite;
}

/* The glow intensifies at 50% of the animation cycle,
   creating a breathing/pulsing effect */
@keyframes greenPulse {
    0%, 100% {
        border-color: #00ff00;
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.4),
                    0 0 20px rgba(0, 255, 0, 0.2);
    }
    50% {
        border-color: #00ff00;
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.8),
                    0 0 40px rgba(0, 255, 0, 0.4),
                    0 0 60px rgba(0, 255, 0, 0.2);
    }
}

/* Unavailable agent - static red border, no animation */
.profile-card.not-available {
    border-color: #ff0000;
}

/* Headshot image - rounded top corners only, so it sits flush
   against the card's top edge. Bottom corners are square to
   flow into the name label below. */
.profile-img {
    width: 100%;
    height: auto;
    border-radius: 4px 4px 0 0;
    display: block;
}

/* Agent name label below the headshot */
.profile-name {
    font-size: 0.95rem;
    padding: 8px 6px;
    margin: 0;
    color: #ffffff;
    background-color: #1a1a1a;   /* Matches card background */
}


/* ============================================================
   PROFILE CARD HOVER OVERLAY
   Positioned absolutely to cover the entire card face.
   Starts invisible (opacity:0) with pointer-events:none so
   it doesn't interfere with clicks when hidden.
   On hover, fades to fully opaque and re-enables pointer
   events so the links inside it become clickable.
============================================================ */
.profile-card-details {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);  /* Near-black, slightly transparent */
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Show overlay when hovering an available card */
.profile-card:hover .profile-card-details {
    opacity: 1;
    pointer-events: auto;
}

/* Show overlay when hovering an unavailable card */
.profile-card-inactive .profile-card:hover .profile-card-details {
    opacity: 1;
    pointer-events: auto;
}

/* Phone number shown in the overlay */
.profile-phone {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: #ffffff;
    font-weight: bold;
}

/* Availability status text ("CLICK TO TALK TO ME" / "NOT AVAILABLE") */
.profile-status {
    font-weight: bold;
    font-size: 0.8rem;
    margin: 4px 0;
    padding: 4px 8px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

/* Green text and subtle green background for available status */
.profile-card.available .profile-status {
    color: #00ff00;
    background-color: rgba(0, 255, 0, 0.1);
}

/* Red text and subtle red background for unavailable status */
.profile-card.not-available .profile-status {
    color: #ff0000;
    background-color: rgba(255, 0, 0, 0.1);
}

/* Wrapper link around the "CLICK TO TALK TO ME" status text.
   Makes the entire status bar clickable to open the c2c URL. */
.profile-status-link {
    display: block;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

/* Highlight the status bar on hover to indicate it's clickable */
.profile-status-link:hover .profile-status {
    background-color: rgba(0, 255, 0, 0.25);
}


/* ============================================================
   PROFILE CONTACT LINKS (Email & Discord)
   Small button-style links shown in the hover overlay.
   display:block + width:100% puts each link on its own line.
   Discord link uses Discord's brand color (#5865F2).
============================================================ */
.profile-contact-link {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-decoration: none;
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #555555;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box;
}

.profile-contact-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #aaaaaa;
    color: #ffffff;
}

/* Discord-branded variant - uses Discord's official blurple color */
.discord-contact-link {
    background-color: rgba(88, 101, 242, 0.2);
    border-color: #5865F2;
    color: #ffffff;
}

.discord-contact-link:hover {
    background-color: rgba(88, 101, 242, 0.4);
    border-color: #7983f5;
    color: #ffffff;
}


/* ============================================================
   UTILITY CLASSES
   Lightweight helper classes for common one-off adjustments
   without needing to write new CSS rules every time.
============================================================ */
.text-center {
    text-align: center;
}

/* Spacing utilities - margin and padding in 1rem increments */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.p-1  { padding: 1rem; }
.p-2  { padding: 2rem; }


/* ============================================================
   FOOTER
   Sits at the bottom of the page with a top border separator.
   Links are displayed in a centered flex row that wraps on
   narrow screens. The copyright year is output dynamically
   by PHP so it never needs to be manually updated.
============================================================ */
.site-footer {
    margin-top: 3rem;
    padding: 2rem 0 1rem 0;
    border-top: 2px solid #333333;
    text-align: center;
}

/* Flex row of footer links - wraps so they stack on mobile */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ffffff;
    font-weight: bold;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #cccccc;
}

/* Copyright line - smaller, muted gray, not bold */
.footer-copyright {
    font-size: 0.85rem;
    color: #999999;
    font-weight: normal;
    margin-top: 1rem;
}

/* Tighter footer link spacing on mobile */
@media screen and (max-width: 768px) {
    .footer-links {
        gap: 1rem;
    }
    
    .footer-copyright {
        font-size: 0.8rem;
    }
}
