/* =========================================
   1. CONFIG & RESET
   ========================================= */
:root {
    --bg-dark: #fdfdff;
    --panel-bg: rgba(1, 9, 32, 0.9);
    --article-bg: rgba(1, 9, 32, 0.9);
    --border: #060b3b;
    --accent: #fdd87a;
    --highlight: #fdd87a;
    --text: #e3e8ff;
    --font: 'Lato', sans-serif;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    font-family: var(--font);
    color: var(--text);
    margin: 0;
    padding: 0;
    background-image: url('/images/backgrounds/webbackground.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

/* Dark Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.container {
    width: fit-content; 
    min-width: 100%; 
    margin: 0 auto;
    padding: 20px;
}

/* =========================================
   2. MAIN GRID LAYOUT
   ========================================= */
.main-grid {
    display: grid;
    /* Left: 450px | Middle: Auto | Right: 300px */
    grid-template-columns: 450px 1fr 300px; 
    gap: 10px;
    align-items: start;
    grid-template-rows: auto;
}

.middle-col {
    display: flex;
    flex-direction: column;
    width: 100%;
    grid-column: auto;
    grid-row: auto;
}

/* Common Sidebar Styling */
.sidebar {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.left-sidebar {
    position: static;
    grid-column: auto;
    grid-row: auto;
}

.right-sidebar {
    position: static;
    width: 90%;
    grid-column: auto;
    grid-row: auto;
    align-self: start; 
    margin-top: 0;
}

.sidebar-header {
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.sidebar-header h3 {
    margin: 0;
    color: var(--highlight);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* Sidebar Spacer */
.sidebar-spacer {
    height: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

/* About Card */
.about-card {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 15px;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--highlight);
    box-shadow: 0 0 10px rgba(253, 216, 122, 0.3);
}

.about-info h4 { margin: 0; color: #fff; font-size: 1.1rem; }
.about-info span { font-size: 0.85rem; }

.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 10px 0;
}

/* Job Grid */
.job-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 8px;
}

.job-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 5px;
    border-radius: 4px;
    transition: 0.2s;
}

.job-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.job-item img {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

.job-item span {
    font-size: 0.75rem;
    color: var(--highlight);
    font-weight: bold;
    font-family: monospace;
}

/* =========================================
   3. SLIM HEADER (The Ticker)
   ========================================= */
.status-ticker {
    width: 600px;
    height: 120px;
    margin-bottom: 30px;
    
    background: #000;
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.character-profile {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center; /* Tweak: Vertically Center */
    padding: 0 15px;     /* Tweak: Tighter padding */
    
    background-color: rgba(0,0,0,0.4);
    background-position: center;
    background-size: cover;
    background-blend-mode: overlay;
    transition: background-image 0.5s ease;
}

.ticker-data {
    display: grid;
    /* Tweak: 2 Columns (55% / 45%) */
    grid-template-columns: 55% 45%; 
    grid-template-rows: auto auto;
    
    /* Tweak: Gap settings */
    column-gap: 10px; 
    row-gap: 5px;     
    
    /* Tweak: Glassy White Style & Dimensions */
    width: 320px; 
    max-width: 320px;
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(10px);
    
    padding: 10px 15px;
    border-radius: 8px;
}

.data-item {
    display: flex;
    flex-direction: column; /* Tweak: Stack Label on top of Value */
    align-items: flex-start;
    justify-content: center;
    
    min-height: 0; 
    overflow: visible; 
}

.data-item strong { 
    color: #ccc; 
    text-transform: uppercase; 
    font-size: 0.65rem; 
    margin-bottom: 2px;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); /* Tweak: Shadow */
}

.data-item span { 
    color: var(--highlight); 
    font-weight: 700;
    
    /* Tweak: Sizing & Wrapping */
    font-size: 0.85rem; 
    line-height: 1.1;   
    white-space: normal; 
    word-wrap: break-word;
    width: 100%;
    
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); /* Tweak: Shadow */
}

.ticker-status {
    /* Tweak: Glassy White Style */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    
    padding: 8px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); /* Tweak: Shadow */
}

.job-icon, .status-icon { width: 28px; height: 28px; vertical-align: middle; }

/* =========================================
   4. BLOG POSTS
   ========================================= */
.blog-post {
    background: var(--article-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(5, 5, 5, 0.3);
    text-align: center;
    width: 95%; 
}

.post-header h2 {
    margin: 0 0 10px 0;
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(13, 29, 109, 0.4);
}

.post-meta {
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.post-body {
    line-height: 1.8;
    color: #ddd;
    font-size: 1.1rem;
}

.post-body p { margin-bottom: 20px; }
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }

/* =========================================
   5. BUTTONS & FORMS
   ========================================= */
.action-btn.secondary {
    width: 100%;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 15px;
}

.action-btn.secondary:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px var(--accent);
}

#submission-form button {
    width: 100%;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: bold;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font);
    text-transform: uppercase;
    margin-top: 10px;
    transition: 0.2s;
}
#submission-form button:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px var(--accent);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #888;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}
.back-link:hover { color: var(--highlight); text-decoration: underline; }

textarea {
    width: 100%;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    color: #fff;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-family: var(--font);
    resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }

#submissions-container {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 5px;
}
#submissions-container::-webkit-scrollbar { width: 5px; }
#submissions-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.submission-card {
    background: rgba(0,0,0,0.3);
    border-left: 3px solid var(--border);
    padding: 12px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
}
.submission-card:hover { border-left-color: var(--accent); background: rgba(0,0,0,0.5); }
.submission-card small { color: #666; font-size: 0.8rem; display: block; margin-top: 5px; }

.subtle-text { color: #aaa; font-size: 0.9rem; margin-bottom: 15px; }
.center-text { text-align: center; }
.loading-text { text-align: center; color: #888; font-style: italic; }

/* =========================================
   6. RESPONSIVE (MOBILE & TABLET)
   ========================================= */
@media (max-width: 1200px) {
    /* 1. FIX THE CONTAINER WIDTH */
    .container {
        width: 100%; /* Force it to fit the screen */
        padding: 10px; /* Smaller padding for mobile */
        overflow-x: hidden; /* Prevent horizontal scroll */
    }

    /* 2. REORDER SECTIONS */
    .main-grid {
        display: flex;           /* Switch to Flexbox for easier reordering */
        flex-direction: column;  /* Stack vertically */
        gap: 40px;               /* Space between major sections */
    }

    /* Order: 1 (Top), 2 (Middle), 3 (Bottom) */
    .middle-col { order: 1; }    /* Show Character/Blog FIRST */
    .right-sidebar { order: 2; } /* Show "About Me/Suggestions" SECOND */
    .left-sidebar { order: 3; }  /* Show "Complaint Box" LAST */

    /* 3. MAKE FIXED ELEMENTS FLUID */
    .status-ticker {
        width: 100%; /* No more 600px fixed width */
        height: auto;
        padding: 20px 0;
    }

    .character-profile {
        flex-direction: column;
        gap: 20px;
        padding: 20px 10px;
    }

    /* Allow the data box to shrink on very small phones */
    .ticker-data {
        width: 100%;
        max-width: 340px; 
    }
    
    .ticker-status {
        margin-top: 10px;
    }

    /* 4. SIDEBAR ADJUSTMENTS */
    .right-sidebar, 
    .left-sidebar {
        width: 100%; /* Full width sidebar */
    }
    
    .blog-post {
        width: 100%;
    }
}
