/* 
   SOAR Board Prototype - Official APSU Branding
   Based on the APSU University Brand and Identity Guidelines
*/

:root {
    /* Official APSU Primary Color Palette */
    --apsu-red: #C41E3A;          /* Pantone 200 / Governors Red */
    --apsu-black: #000000;        /* Pantone Black */
    --apsu-dark-gray: #404040;    /* Pantone Cool Gray 10 */
    --apsu-silver-gray: #9EA8A8;  /* Pantone 429 */
    --apsu-white: #FFFFFF;

    /* Layout Heights */
    --header-height-mobile: 50px;
    --header-height-desktop: 65px;
    --nav-height: 70px;

    /* Theme Application Variables (Light Mode Default) */
    --bg-color: #F4F5F7; 
    --card-bg: var(--apsu-white);
    --text-main: var(--apsu-black);
    --text-muted: var(--apsu-dark-gray);
    --border-color: var(--apsu-silver-gray);
    --card-shadow: 0 4px 6px rgba(0,0,0,0.08);

    /* 
       Official Font Stack: 
       Gotham is primary. Helvetica is the official university fallback. 
    */
    --font-primary: 'Gotham', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Dark Mode Overrides (Utilizing APSU Black and Dark Gray) */
[data-theme="dark"] {
    --bg-color: var(--apsu-black);
    --card-bg: #1A1A1A; 
    --text-main: var(--apsu-white);
    --text-muted: var(--apsu-silver-gray);
    --border-color: var(--apsu-dark-gray);
    --card-shadow: 0 4px 12px rgba(196, 30, 58, 0.15); /* Subtle Governors Red glow */
}

/* Global Styles */
body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: var(--header-height-mobile);
    padding-bottom: var(--nav-height);
}

@media (min-width: 769px) {
    body {
        padding-top: var(--header-height-desktop);
        padding-bottom: 0;
    }
}

body[data-theme="light"] {
    background-color: var(--bg-color);
}

body[data-theme="dark"] {
    background-color: var(--bg-color);
}

/* Header */
header {
    background-color: var(--apsu-red);
    color: var(--apsu-white);
    padding: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 5px solid var(--apsu-black);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    height: var(--header-height-mobile);
    box-sizing: border-box;
    padding: 0 0.75rem;
}

header.header-hidden {
    transform: translateY(-100%);
}

header h1 { 
    margin: 0; 
    font-size: 1.3rem; 
    font-weight: 700;
    letter-spacing: -0.5px;
    display: none;
}

header p { 
    margin: 0; 
    font-size: 0.75rem; 
    opacity: 0.9; 
    font-weight: 400;
    display: none;
}

/* Desktop Header */
@media (min-width: 769px) {
    header {
        height: var(--header-height-desktop);
        padding: 0 2rem;
        gap: 1.5rem;
    }
    header h1 {
        font-size: 2rem;
    }
    header p {
        font-size: 0.95rem;
    }
}

/* Theme Toggle Button */
.theme-btn {
    background: transparent;
    border: 2px solid var(--apsu-white);
    color: var(--apsu-white);
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-family: var(--font-primary);
    transition: background 0.2s, color 0.2s;
}

.theme-btn:hover { 
    background: var(--apsu-white); 
    color: var(--apsu-red); 
}

/* Layout Container */
.container {
    display: block; /* This breaks it out of the 2-column grid! */
    max-width: 720px; /* 60% wider than original */
    margin: 2.5rem auto;
    padding: 0 1rem;
}

/* Sidebar Filters */
.sidebar {
    background: var(--card-bg);
    padding: 1.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    height: fit-content;
    box-shadow: var(--card-shadow);
    transition: background-color 0.3s, border-color 0.3s;
}

.sidebar h3 { 
    border-bottom: 3px solid var(--apsu-red); 
    padding-bottom: 0.5rem; 
    margin-top: 0;
    font-weight: 700;
}

.filter-group { 
    display: flex; 
    flex-direction: column; 
    gap: 0.75rem; 
    margin-bottom: 2rem; 
}

.filter-group label {
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-btn {
    background-color: var(--apsu-red);
    color: var(--apsu-white);
    border: 2px solid var(--apsu-red);
    padding: 0.85rem;
    width: 100%;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.05rem;
    cursor: pointer;
    margin-bottom: 2rem;
    font-family: var(--font-primary);
    transition: all 0.2s;
}

.post-btn:hover {
    background-color: transparent;
    color: var(--apsu-red);
}

/* Search Bar */
.search-bar {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    background: #1a1a1a;
    color: #e8e8e8;
    border: 2px solid #404040;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: var(--font-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    height: 36px;
}

@media (min-width: 769px) {
    .search-bar {
        width: 50%;
        flex: none;
        padding: 0.6rem 1rem 0.6rem 60px;
        font-size: 1rem;
    }
}

[data-theme="light"] .search-bar {
    background: #f8fafc;
    color: #1a1a1a;
    border-color: #cbd5e1;
}

[data-theme="dark"] .search-bar {
    background: #1a1a1a;
    color: #e8e8e8;
    border-color: #404040;
}

.search-bar::placeholder {
    color: #999999;
}

[data-theme="light"] .search-bar::placeholder {
    color: #999999;
}

[data-theme="dark"] .search-bar::placeholder {
    color: #888888;
}

.search-bar:focus { 
    outline: none; 
    border-color: var(--apsu-red); 
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.2); 
}

/* The Board Grid */
.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

/* Bounty Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: 6px solid var(--apsu-red); /* Strong brand accent on every card */
    border-radius: 8px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.card-title { 
    margin: 0; 
    font-size: 1.25rem; 
    color: var(--text-main); 
    font-weight: 700; 
    line-height: 1.3;
}

.card-meta { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    margin-top: 0.5rem; 
    font-weight: 500;
}

.card-body { 
    font-size: 0.95rem; 
    margin: 1.25rem 0; 
    line-height: 1.6; 
    flex-grow: 1; 
}

/* Status Tags (Designed to complement APSU branding) */
.tag-container { 
    display: flex; 
    gap: 0.5rem; 
    flex-wrap: wrap; 
    margin-top: 1rem; 
}

.tag { 
    font-size: 0.75rem; 
    padding: 0.35rem 0.75rem; 
    border-radius: 4px; 
    font-weight: 700; 
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Refined Tag Colors based on APSU grays and subtle tones */
.tag-Participant { background: #E2E8F0; color: #1E293B; }
.tag-Data { background: #FEE2E2; color: #991B1B; } /* Subtle red nod */
.tag-Lit { background: #F1F5F9; color: #334155; }
.tag-Project { background: var(--apsu-silver-gray); color: var(--apsu-black); }
.tag-apsu { border: 1px solid var(--apsu-dark-gray); color: var(--text-main); }
.tag-external { background: var(--apsu-black); color: var(--apsu-white); }

/* Abstracted Connect Buttons (Multi-Method Support) */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.methods-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.connect-btn {
    background-color: transparent;
    color: var(--apsu-red);
    border: 2px solid var(--apsu-red);
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    flex: 1 1 auto; /* Allows buttons to share space evenly */
    text-align: center;
    transition: all 0.2s;
    font-family: var(--font-primary);
}

.connect-btn:hover { 
    background-color: var(--apsu-red); 
    color: var(--apsu-white); 
}

.no-results { 
    grid-column: 1 / -1; 
    text-align: center; 
    padding: 4rem; 
    color: var(--text-muted); 
    font-size: 1.2rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
}

/* Bottom Navigation - Mobile */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 70px;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.bottom-nav a, .bottom-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 0.7rem;
    transition: color 0.2s;
    width: 25%;
}

.bottom-nav a:hover, .bottom-nav button:hover {
    color: var(--apsu-red);
}

.bottom-nav a.active, .bottom-nav button.active {
    color: var(--apsu-red);
}

.bottom-nav img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }

    /* Hide hamburger on desktop */
    .hamburger {
        display: none !important;
    }

    /* Show APSU logo on desktop */
    .header-apsu-logo {
        display: block !important;
    }

    /* Show Governors logo on desktop */
    .header-logo {
        display: flex !important;
    }

    /* Show header actions on desktop */
    .header-actions {
        display: flex !important;
        gap: 1rem;
        align-items: center;
        margin-left: auto;
    }

    .header-actions a {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--apsu-white);
        width: 32px;
        height: 32px;
        border-radius: 4px;
        transition: background-color 0.2s;
    }

    .header-actions a:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }

    .header-actions img {
        width: 20px;
        height: 20px;
        filter: brightness(0) invert(1);
    }

    /* Sidebar nav on desktop */
    .sidebar-nav {
        position: fixed;
        left: 0;
        top: var(--header-height-desktop);
        width: 250px;
        height: calc(100vh - var(--header-height-desktop));
        flex-direction: column;
        background: var(--card-bg);
        z-index: 50;
        padding: 1rem 0;
        overflow-y: auto;
    }

    /* Adjust container for sidebar */
    .container {
        margin-left: 250px !important;
        max-width: 900px !important;
    }
}

/* Hamburger Menu */
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 101;
    position: relative;
    flex-shrink: 0;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-main);
    transition: all 0.3s;
    display: block;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Header Actions */
.header-actions {
    display: none;
    gap: 1rem;
    align-items: center;
    margin-left: auto;
}

/* Header Logos */
.header-apsu-logo {
    display: none;
    height: 40px;
    min-width: 80px;
    flex-shrink: 0;
    margin-right: auto;
}

.header-apsu-logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.header-logo {
    display: none;
    height: 35px;
    width: 35px;
    flex-shrink: 0;
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Logo Theming */
[data-theme="dark"] .header-apsu-logo img {
    filter: brightness(0) invert(1);
}

[data-theme="light"] .header-apsu-logo img {
    filter: brightness(0);
}

@media (min-width: 769px) {
    .header-apsu-logo {
        display: block;
    }

    .header-logo {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: var(--text-main);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(196, 30, 58, 0.1);
    color: var(--apsu-red);
}

.nav-link.active {
    background-color: rgba(196, 30, 58, 0.15);
    color: var(--apsu-red);
    border-left: 4px solid var(--apsu-red);
    padding-left: calc(1rem - 4px);
}

.nav-link img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Filter Panel */
.filter-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--apsu-red);
    padding: 1rem;
    box-sizing: border-box;
    z-index: 99;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, max-height 0.3s ease;
}

.filter-panel.active {
    opacity: 1;
    visibility: visible;
    max-height: 500px;
}

/* Side Menu */
.side-menu {
    position: fixed;
    left: -100%;
    top: 50px;
    width: 80%;
    max-width: 300px;
    height: calc(100% - 50px);
    background: var(--card-bg);
    transition: left 0.3s ease;
    z-index: 99;
    overflow-y: auto;
    padding-top: 0;
}

.side-menu.active {
    left: 0;
}

.side-menu h3 {
    padding: 1rem;
    margin: 0;
    border-bottom: 2px solid var(--apsu-red);
    color: var(--apsu-red);
}

.side-menu .filter-group {
    padding: 0.75rem 1rem;
}

.side-menu-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 98;
}

.side-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Time Posted */
.time-posted {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ====================================
   MOBILE RESPONSIVE DESIGN
   ==================================== */

/* Small Phones (375px - 480px) */
@media (max-width: 480px) {
    body {
        padding-top: 70px;
        padding-bottom: 70px;
    }

    /* Layout Container */
    .container {
        max-width: 100% !important;
        padding: 0 0.75rem !important;
        margin: 0.5rem auto !important;
    }

    /* Search Bar and Buttons */
    .search-bar {
        padding: 0.75rem;
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .search-btn, .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    /* Board Grid - Stack on mobile */
    .board-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
        border-radius: 6px;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-body {
        font-size: 0.9rem;
        margin: 0.75rem 0;
    }

    /* Tags */
    .tag {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    /* Action Buttons */
    .action-buttons {
        gap: 0.5rem;
    }

    .action-buttons button {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Sidebar - Hide on mobile, show as collapsible */
    .sidebar {
        display: none;
    }

    /* Filter Panel - Full width when shown */
    .filter-panel {
        width: 100%;
        max-width: 100%;
        position: static;
        background: var(--card-bg);
        padding: 1rem;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 6px;
    }

    .filter-group {
        margin-bottom: 1rem;
    }

    /* Header Actions */
    .header-actions {
        font-size: 0.75rem;
    }
}

/* Tablets and Medium Phones (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    /* Layout Container */
    .container {
        max-width: 100% !important;
        padding: 0 1rem !important;
        margin: 1.5rem auto !important;
    }

    /* Board Grid */
    .board-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    /* Cards */
    .card {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    /* Sidebar - Show as narrow on tablets */
    .sidebar {
        padding: 1.25rem;
    }

    /* Search Bar */
    .search-bar {
        padding: 1rem;
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    /* Action Buttons */
    .action-buttons button {
        padding: 0.65rem 1rem;
        font-size: 0.8rem;
    }
}

/* Large Screens (769px+) */
@media (min-width: 769px) {
    /* Original layout preserved */
    .board-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}