/* ==========================================================================
   1. GLOBAL STYLES & TYPOGRAPHY
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@700&family=Roboto:wght@400;700&display=swap');

:root {
    --primary-orange: #FF8C00;
    --dark-bg: #1a1a1a;
    --light-bg: #f4f4f4;
    --white: #ffffff;
}

* { box-sizing: border-box; }

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--light-bg);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* ==========================================================================
   2. HEADER & HORIZONTAL NAV
   ========================================================================== */
.site-header { background: #000; border-bottom: 5px solid var(--primary-orange); }

.search-container { padding: 15px 0; display: flex; justify-content: center; background: #222; }

.search-form { display: flex; width: 90%; max-width: 600px; }

.search-input { flex: 1; padding: 10px; border-radius: 4px 0 0 4px; border: none; }

.search-button { background: var(--primary-orange); border: none; padding: 10px 20px; font-weight: bold; cursor: pointer; border-radius: 0 4px 4px 0; }

.main-nav ul { list-style: none; display: flex; justify-content: center; background: #000; margin: 0; padding: 0; }

.main-nav li a { color: #fff; text-decoration: none; padding: 15px 25px; display: block; font-weight: bold; text-transform: uppercase; font-size: 0.9rem; }

.main-nav li a:hover { color: var(--primary-orange); }

/* ==========================================================================
   3. LAYOUT CONTAINERS
   ========================================================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.hero-title h1 {
    font-family: 'Oswald', sans-serif;
    text-align: center;
    padding: 40px 0;
    font-size: 2.5rem;
    color: var(--dark-bg);
    text-transform: uppercase;
}

.main-content {
    display: flex; /* Aligns sidebar and content side-by-side */
    gap: 30px;
    margin-bottom: 50px;
}

/* ==========================================================================
   4. SIDEBAR & CONTENT
   ========================================================================== */
.sidebar {
    flex: 0 0 280px;
    background: #000;
    color: #fff;
    padding: 25px;
    border-radius: 4px;
    border-top: 5px solid var(--primary-orange);
}

.sidebar h3 { font-family: 'Oswald', sans-serif; color: var(--primary-orange); margin-top: 0; border-bottom: 1px solid #333; padding-bottom: 10px; }

#guide-list { list-style: none; padding: 0; }

#guide-list li a { color: #fff; text-decoration: none; display: block; padding: 10px 0; border-bottom: 1px solid #222; font-size: 0.95rem; }

#guide-list li a:hover { color: var(--primary-orange); padding-left: 5px; transition: 0.2s; }

.featured-area { flex: 1; }

.welcome-text {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.welcome-text h1 { font-family: 'Oswald', sans-serif; font-size: 2.2rem; margin-top: 0; color: #111; }

.banner-img { width: 100%; height: auto; border-radius: 4px; margin: 20px 0; }

/* ==========================================================================
   5. FEATURE GRID
   ========================================================================== */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 30px; }

.feature-box { background: #f9f9f9; padding: 20px; border-left: 4px solid var(--primary-orange); }

.feature-box h3 { font-family: 'Oswald', sans-serif; margin-top: 0; font-size: 1.1rem; }

/* Mobile Stack */
@media (max-width: 900px) {
    .main-content { flex-direction: column; }
    .sidebar { width: 100%; flex: none; }
}

/* ==========================================================================
   6. FOOTER STYLING (.site-footer)
   Centers text and cleans up the bottom of the landing page.
   ========================================================================== */
.site-footer {
    background: #1a1a1a; /* Matches your dark header/sidebar */
    color: #ffffff;
    padding: 40px 0;
    text-align: center;
    border-top: 5px solid var(--primary-orange);
    margin-top: 50px;
}

.site-footer p {
    margin: 5px 0;
    font-size: 0.95rem;
}

.footer-tagline {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    color: var(--primary-orange);
    letter-spacing: 1px;
    font-size: 0.85rem !important;
}

.footer-nav {
    margin-top: 20px;
}

.footer-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

.footer-nav a:hover {
    color: var(--primary-orange);
    border-bottom: 1px solid var(--primary-orange);
    
/* ==========================================================================
   7. ADMIN FORM STYLING
   ========================================================================== */
.admin-container { max-width: 900px; margin: 40px auto; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
.admin-form .form-group { margin-bottom: 20px; }
.admin-form label { display: block; font-weight: bold; margin-bottom: 8px; font-family: 'Oswald', sans-serif; text-transform: uppercase; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.admin-form .row { display: flex; gap: 20px; }
.admin-form .col { flex: 1; }
.btn-save { background: var(--primary-orange); color: #000; border: none; padding: 15px 30px; font-weight: bold; cursor: pointer; border-radius: 4px; font-family: 'Oswald', sans-serif; }
.btn-save:hover { background: #e07b00; }
.btn-cancel { color: #666; text-decoration: none; margin-left: 15px; font-size: 0.9rem; }

/* ==========================================================================
   8. ADMIN DASHBOARD BUTTONS
   ========================================================================== */
.btn-action {
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-action.view {
    background: #444; /* Dark gray for viewing */
}

.btn-action.edit {
    background: #FF8C00; /* Orange to match your brand */
    color: #000;
}

.btn-action.delete {
    background: #dc3545; /* Standard red for delete */
}

.btn-action:hover {
    opacity: 0.9;
    filter: brightness(1.1);
}
}

/* ==========================================================================
   9. ADMIN DASHBOARD BUTTON STYLES
   Converts text links into solid action buttons.
   ========================================================================== */
.actions-cell {
    display: flex;
    gap: 8px; /* Spacing between buttons */
    padding: 10px;
}

.btn-action {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none; /* Removes the blue underline */
    text-transform: uppercase;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

/* Specific Colors for Actions */
.btn-action.view {
    background: #4a4a4a; /* Dark grey for "View" */
    color: #ffffff;
}

.btn-action.edit {
    background: #FF8C00; /* Brand Orange for "Edit" */
    color: #000000;
}

.btn-action.delete {
    background: #e74c3c; /* Red for "Delete" */
    color: #ffffff;
}

/* Hover Effects */
.btn-action:hover {
    transform: translateY(-2px); /* Subtle lift effect */
    filter: brightness(1.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-action:active {
    transform: translateY(0);
}

/* ==========================================================================
   10. ADMIN EDITOR STYLING (edit_guide.php)
   ========================================================================== */
.admin-editor-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.admin-card {
    background: #2a2a2a; /* Slightly lighter than the main body for depth */
    padding: 40px;
    border-radius: 8px;
    border-top: 5px solid var(--primary-orange);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.admin-card h2 {
    font-family: 'Oswald', sans-serif;
    color: var(--primary-orange);
    text-transform: uppercase;
    margin-bottom: 30px;
    font-size: 2rem;
}

/* Form Grouping */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: var(--primary-orange);
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #111;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: var(--primary-orange);
    outline: none;
}

/* Active Button Actions */
.editor-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.btn-save-manual {
    background: var(--primary-orange);
    color: #000;
    border: none;
    padding: 15px 35px;
    font-weight: bold;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save-manual:hover {
    background: #e07b00;
    transform: scale(1.02);
}

.btn-cancel-link {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.btn-cancel-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* ==========================================================================
   11. MARKDOWN PREVIEW STYLING
   ========================================================================== */
.btn-preview {
    background: #444;
    color: #fff;
    border: 1px solid #666;
    padding: 15px 25px;
    font-weight: bold;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-preview:hover {
    background: #555;
    border-color: var(--primary-orange);
}

/* Modal Background */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.85); /* Dimmed background */
}

/* Modal Box */
.modal-content {
    background-color: #fff;
    color: #333;
    margin: 5% auto; 
    padding: 40px;
    border-radius: 8px;
    width: 80%; 
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto; /* Scroll if content is long */
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover { color: #000; }

/* Styling for the content inside the preview */
.markdown-body h1, .markdown-body h2 { color: #111; border-bottom: 1px solid #ddd; padding-bottom: 10px; }
.markdown-body ul { padding-left: 20px; }
.markdown-body blockquote { border-left: 4px solid var(--primary-orange); padding-left: 15px; color: #666; font-style: italic; }

/* ==========================================================================
   12. PUBLIC GUIDE PAGE STYLING (Refined for Images & Branding)
   ========================================================================== */

/* Featured Image Styling - Added to handle the new uploads folder images */
.guide-featured-image-wrapper {
    width: 100%;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    border-bottom: 5px solid var(--primary-orange);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.guide-featured-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.guide-header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    border-left: 10px solid var(--primary-orange);
    padding-left: 20px;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

/* Updated Meta Badges to match your dark/orange brand */
.guide-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.meta-badge {
    background: #1a1a1a;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--primary-orange);
    border: 1px solid #333;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

.guide-divider {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 35px 0;
}

/* Rendering styles for TinyMCE Content */
.guide-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.guide-body h2 { color: var(--dark-bg); margin-top: 35px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.guide-body ul, .guide-body ol { padding-left: 30px; margin-bottom: 25px; }
.guide-body li { margin-bottom: 10px; }
.guide-body strong { color: #000; font-weight: 700; }

/* Custom Highlight from our TinyMCE Orange Button */
.guide-body span[style*="color: #FF8C00"] {
    background: rgba(255, 140, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

/* ==========================================================================
   13. CUSTOM FILE UPLOAD STYLING
   ========================================================================== */
.custom-file-upload {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

/* Hide the actual input */
.custom-file-upload input[type="file"] {
    display: none;
}

/* Style the label to look like a button */
.file-upload-btn {
    background: #000;
    color: var(--primary-orange);
    border: 2px solid var(--primary-orange);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.file-upload-btn:hover {
    background: var(--primary-orange);
    color: #000;
}

#file-name-display {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
}

.admin-preview-thumb {
    width: 150px; 
    border-radius: 4px; 
    border: 1px solid var(--primary-orange);
    display: block;
}