/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --primary-color: #0066cc; /* Tech Blue */
    --secondary-color: #004488; /* Darker Blue */
    --accent-color: #ff9900; /* Action Orange */
    --text-dark: #333333;
    --text-light: #f4f4f4;
    --white: #ffffff;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 80px;
    display: flex;
    align-items: center;
}

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

.logo img {
    height: 60px;
    width: auto;
    display: block;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--primary-color);
}

.cta-button {
    background: var(--primary-color);
    color: var(--white) !important;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: inline-block;
    font-family: inherit;
}

.cta-button:hover {
    background: var(--secondary-color);
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero {
    background: linear-gradient(rgba(0, 68, 136, 0.85), rgba(0, 30, 60, 0.9)), 
                url('https://images.unsplash.com/photo-1597852074816-d933c7d2b988?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 6rem 20px;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   4. LAYOUT & SERVICES
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 2rem;
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* =========================================
   5. CONTACT & FORMS
   ========================================= */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.contact-info p {
    margin-bottom: 2rem;
    color: #666;
}

.info-item {
    margin-bottom: 1.5rem;
}

.info-item strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.info-item a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
}

.info-item a:hover {
    color: var(--primary-color);
}

/* Universal Form Styling */
.contact-form-wrapper {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block; 
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.form-group input, 
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus, 
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.captcha-group input {
    width: 50%;
}

.submit-btn {
    width: 100%;
    font-weight: bold;
    margin-top: 10px;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* =========================================
   6. PROJECT LLAMA (SUPPORT SYSTEM)
   ========================================= */

/* Llama Animation */
.llama-icon {
    display: inline-block;
    animation: bounce 2s infinite;
    margin-left: 5px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}

.empty-pasture {
    text-align: center;
    padding: 40px;
    color: #888;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* Status Badges */
.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.status-open {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-closed {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status-onhold {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Chat Bubbles */
.chat-box {
    background: #f8f9fa; 
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
    margin-top: 15px;
}

.message-row {
    display: flex;
    margin-bottom: 15px;
}

.message-row.me {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 18px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message-row.me .message-bubble {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 2px;
}

.message-row.me .message-bubble a {
    color: white;
    text-decoration: underline;
}

.message-row.them .message-bubble {
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 2px;
}

.message-meta {
    font-size: 0.75rem;
    margin-top: 5px;
    opacity: 0.7;
}

.message-row.me .message-meta { text-align: right; }

/* Chat Images */
.chat-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
    cursor: zoom-in;
    border: 1px solid #ddd;
    display: block;
    transition: transform 0.2s;
}

.chat-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.admin-table th {
    background-color: var(--secondary-color);
    color: white;
    padding: 12px;
    text-align: left;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-table tr:hover {
    background-color: #f1f1f1;
}

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Lightbox Overlay */
#lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

#lightbox-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform:scale(0.8); opacity:0;}
    to {transform:scale(1); opacity:1;}
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* =========================================
   7. FOOTER
   ========================================= */
footer {
    background: #222;
    color: #ccc;
    padding: 4rem 20px 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-col a {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
}

.footer-col a:hover {
    color: var(--white);
}

.copyright {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 2rem;
    font-size: 0.9rem;
}

/* =========================================
   8. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    header { height: auto; padding: 10px 0; }
    .nav-container { flex-direction: column; gap: 1rem; }
    .hero h1 { font-size: 2.2rem; }
    .contact-layout { grid-template-columns: 1fr; gap: 3rem; }
    .contact-form-wrapper { padding: 1.5rem; }
    .captcha-group input { width: 100%; }
    
    .admin-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
    .message-bubble { max-width: 85%; }
    .cta-button { width: 100%; text-align: center; margin-bottom: 5px; }
}

/* =========================================
   9. STANDARD DARK MODE (Toggleable)
   ========================================= */
body.theme-dark {
    /* Dark Mode Brand Colors */
    --primary-color: #3399ff; /* Lighter Blue for contrast */
    --secondary-color: #0066cc;
    --accent-color: #ff9900;

    /* Global Dark Overrides */
    --white: #1f1f1f;
    --text-dark: #f0f0f0;
    --text-light: #cccccc;
    background-color: #121212; /* Removed !important to let holidays win */
    color: #f0f0f0;
}

/* Header & Background */
body.theme-dark header {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

/* Fix Hero Text */
body.theme-dark .hero h1, 
body.theme-dark .hero p {
    color: #ffffff !important;
    text-shadow: 0 2px 5px rgba(0,0,0,1);
}

/* Cards, Forms, Chat */
body.theme-dark .card,
body.theme-dark .contact-form-wrapper,
body.theme-dark .chat-box {
    background-color: #1f1f1f;
    border: 1px solid #333;
    color: #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* Inputs */
body.theme-dark input,
body.theme-dark textarea,
body.theme-dark select {
    background-color: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
}

/* Admin Tables */
body.theme-dark .admin-table { background-color: #1f1f1f; color: #eee; }
body.theme-dark .admin-table th { background-color: #2a2a2a; color: var(--primary-color); }
body.theme-dark .admin-table td { border-bottom: 1px solid #333; }
body.theme-dark .admin-table tr:hover { background-color: #2a2a2a; }

/* Text Headings */
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3, 
body.theme-dark h4, body.theme-dark h5, body.theme-dark h6 {
    color: var(--primary-color) !important;
}
body.theme-dark .header-user-info,
body.theme-dark span {
    color: #ccc;
}

/* Links */
body.theme-dark nav a { color: #f0f0f0; }
body.theme-dark nav a:hover { color: var(--primary-color); }
body.theme-dark .footer-col a { color: #aaa; }
body.theme-dark .footer-col a:hover { color: var(--primary-color); }

/* =========================================
   10. HOLIDAY THEMES (MUST BE LAST)
   ========================================= */

/* ----- New Year's (Gold & Black) ----- */
body.theme-newyear {
    --primary-color: #d4af37; /* Gold */
    --secondary-color: #222;  /* Black */
    --accent-color: #d4af37;
}
body.theme-newyear header { border-bottom: 3px solid var(--accent-color); }
body.theme-newyear .hero {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.9)), 
    url('/images/holiday_newyear.jpg');
    background-size: cover; background-position: center;
}

/* ----- July 4th (Red, White & Blue) ----- */
body.theme-july4 {
    --primary-color: #002868; /* Navy */
    --secondary-color: #bf0a30; /* Red */
    --accent-color: #bf0a30;
}
body.theme-july4 header { border-bottom: 3px solid var(--accent-color); }
body.theme-july4 .hero {
    background: linear-gradient(rgba(0, 40, 104, 0.7), rgba(191, 10, 48, 0.6)), 
    url('/images/holiday_july4.jpg');
    background-size: cover; background-position: center;
}

/* ----- Halloween (COMPLETE DARK MODE) ----- */
body.theme-halloween {
    /* Color Palette */
    --primary-color: #ff6b00; /* Pumpkin Orange */
    --secondary-color: #4a148c; /* Spooky Purple */
    --accent-color: #ff9e40;
    
    /* Global Dark Overrides */
    --white: #1f1f1f;
    --text-dark: #f0f0f0;
    --text-light: #cccccc;
    background-color: #121212 !important;
    color: #f0f0f0;
}

/* FORCE HEADERS TO ORANGE IN DARK MODE */
body.theme-halloween h1, 
body.theme-halloween h2, 
body.theme-halloween h3, 
body.theme-halloween h4, 
body.theme-halloween h5, 
body.theme-halloween h6 {
    color: var(--primary-color) !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Fix the Admin/User "Logged in as" text */
body.theme-halloween .header-user-info,
body.theme-halloween span {
    color: var(--primary-color);
    font-weight: bold;
}

/* 1. Header & Hero Fixes */
body.theme-halloween header { 
    background: #1a1a1a; 
    border-bottom: 3px solid var(--primary-color);
}
body.theme-halloween .hero {
    background: linear-gradient(rgba(20, 0, 30, 0.9), rgba(0, 0, 0, 0.95)), 
    url('/images/holiday_halloween.jpg');
    background-size: cover; background-position: center;
}
/* FORCE WHITE TEXT ON HERO */
body.theme-halloween .hero h1, 
body.theme-halloween .hero p {
    color: #ffffff !important;
    text-shadow: 0 2px 5px rgba(0,0,0,1);
}

/* 2. Support Dashboard & Admin Fixes */
body.theme-halloween .card, 
body.theme-halloween .contact-form-wrapper,
body.theme-halloween .chat-box {
    background-color: #1f1f1f;
    border: 1px solid #333;
    color: #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* Chat Bubbles */
body.theme-halloween .message-row.them .message-bubble {
    background-color: #333;
    color: #fff;
}
body.theme-halloween .message-meta {
    color: #888;
}

/* Forms & Inputs */
body.theme-halloween input,
body.theme-halloween textarea,
body.theme-halloween select {
    background-color: #2a2a2a;
    color: #fff;
    border: 1px solid #444;
}
body.theme-halloween input::placeholder,
body.theme-halloween textarea::placeholder {
    color: #777;
}

/* Tables */
body.theme-halloween .admin-table {
    background-color: #1f1f1f;
    color: #eee;
}
body.theme-halloween .admin-table th {
    background-color: #2a2a2a;
    color: var(--primary-color);
}
body.theme-halloween .admin-table td {
    border-bottom: 1px solid #333;
}
body.theme-halloween .admin-table tr:hover {
    background-color: #2a2a2a;
}

/* Footer Links */
body.theme-halloween .footer-col a { color: #aaa; }
body.theme-halloween .footer-col a:hover { color: var(--primary-color); }

/* ----- Thanksgiving (Autumn) ----- */
body.theme-thanksgiving {
    --primary-color: #d84315; /* Rust */
    --secondary-color: #5d4037; /* Brown */
    --accent-color: #d84315;
}
body.theme-thanksgiving header { border-bottom: 3px solid var(--accent-color); }
body.theme-thanksgiving .hero {
   background: linear-gradient(rgba(93, 64, 55, 0.7), rgba(216, 67, 21, 0.7)),
   url('/images/holiday_thanksgiving.jpg');
   background-size: cover; background-position: center;
}

/* ----- Christmas (Red & Green) ----- */
body.theme-christmas {
    --primary-color: #c62828; /* Red */
    --secondary-color: #1b5e20; /* Dark Green */
    --accent-color: #c62828;
}
body.theme-christmas header { border-bottom: 3px solid var(--accent-color); }
body.theme-christmas .hero {
    background: linear-gradient(rgba(198, 40, 40, 0.6), rgba(27, 94, 32, 0.8)), 
    url('/images/holiday_christmas.jpg');
    background-size: cover; background-position: center;
}