﻿/* ==========================================================================
   1. GLOBAL VARIABLES & RESET
   ========================================================================== */
:root {
    /* Premium Luxury Dark Palette to match Tamar Detailing */
    --bg-main: #090d16; /* Deep midnight obsidian background */
    --bg-card: #0f172a; /* Slightly lighter slate for cards/sections */
    --text-dark: #ffffff; /* Crisp white for headers to stand out */
    --text-muted: #cbd5e1; /* Soft silver-gray for regular readable body text */
    --text-body: #94a3b8; /* Clean slate gray for descriptions */
    --text-light: #64748b; /* Muted metadata text */
    --border-color: #1e293b; /* Subtle, sleek borders */
    /* Brand Accent Colors pulled directly from your logo's bridge sky & lighting */
    --primary: #ffffff;
    --primary-hover: #e2e8f0;
    --accent: #38bdf8; /* The striking electric cyan blue from your logo's dash lines */
    --accent-hover: #0ea5e9;
    /* Layout Constants */
    --max-width: 1200px;
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box; /* Crucial: Prevents mobile layout spill/overlap */
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* Tells the browser to offset ALL anchor link jumps by 260px to account for the sticky header */
    scroll-padding-top: 260px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-main);
    color: var(--text-muted);
    /* Perfect full-screen vertical & horizontal centering layout */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

    /* This pushes content to center vertically while letting header/footer sit naturally */
    body > .dashboard-container,
    body > .container {
        margin: auto !important; /* The magic bullet for true vertical/horizontal centering */
        width: 100%;
        max-width: 750px; /* Constrains the forms to an elegant, readable column width */
        box-sizing: border-box;
    }

/* Fix spacing for the footer so it locks smoothly at the absolute bottom */
footer {
    margin-top: auto !important;
}

/* ==========================================================================
   2. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.2;
    /* Tells the browser to leave space for the sticky header when jumping to an anchor link */
    
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.85rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    position: relative;
}

p, li {
    color: var(--text-body);
    font-size: 1rem;
    margin-bottom: 1rem;
}

ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   3. REUSABLE UTILITIES & LAYOUTS
   ========================================================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

/* For legal/text heavy pages (like Privacy Policy) to look structured */
.text-content-layout {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

    .text-content-layout h1 {
        border-bottom: 2px solid var(--border-color);
        padding-bottom: 0.5rem;
    }

.last-updated {
    font-style: italic;
    color: var(--text-light);
}


/* ==========================================================================
   4. NAVIGATION BAR
   ========================================================================== */
header {
    background-color: #000000; /* Flat pitch-black matching your logo background perfectly */
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

    nav ul {
        display: flex;
        list-style: none;
        padding: 0;
        margin: 0;
        gap: 2rem;
    }

    nav a {
        text-decoration: none;
        color: var(--text-body);
        font-weight: 500;
        transition: var(--transition);
    }

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

.nav-cta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Desktop sizing default */
.logo img {
    height: 200px;
    width: auto;
}


/* ==========================================================================
   5. BUTTONS
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-login {
    display: inline-block;
    text-decoration: none;
    /* Increased padding: 12px top/bottom, 24px left/right */
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    line-height: 1.2; /* Ensures letter hooks don't hit the border */
    transition: var(--transition);
    text-align: center;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent);
    color: #090d16;
}

    .btn-primary:hover {
        background-color: var(--accent-hover);
        color: #ffffff;
    }

.btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid var(--border-color);
}

    .btn-secondary:hover {
        background-color: var(--border-color);
        color: #ffffff;
    }

.btn-login {
    color: var(--text-body);
}

    .btn-login:hover {
        color: var(--text-dark);
    }

.btn-large {
    padding: 1rem 2.25rem;
    font-size: 1.1rem;
}

/* ==========================================================================
   6. CARDS & GRIDS (Services / Features)
   ========================================================================== */
.service-grid, .feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2.5rem;
}

.service-card, .feature-card {
    background-color: var(--bg-card);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

    .service-card:hover, .feature-card:hover {
        transform: translateY(-4px);
        box-shadow: 15px 15px 30px rgb(25, 25, 25), -15px -15px 30px rgb(60, 60, 60);
        border-radius: 30px;
        background: #35578c;
    }

    .service-card h3, .feature-card h3 {
        margin-bottom: 0.75rem;
    }

/* ==========================================================================
   7. FOOTER STYLING & SOCIAL LINKS
   ========================================================================== */
footer {
    background: #0b1116;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

    .footer-legal p {
        color: var(--text-muted, #666);
        margin: 0;
        font-size: 0.88rem;
    }

    .footer-legal a {
        color: var(--text-body, #cbd5e1);
        text-decoration: none;
        font-size: 0.88rem;
        transition: color 0.2s ease;
    }

        .footer-legal a:hover {
            color: #007bff;
        }

/* Social Icon/Text Blocks */
.footer-socials {
    display: flex;
    gap: 15px;
}

.social-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 12px;
    background: #111c24;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

    /* Add a subtle brand color glow when hovering over the buttons */
    .social-link:hover {
        background: #007bff;
        border-color: #007bff;
        transform: translateY(-2px);
    }

/* ==========================================================================
   8. MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

        nav ul {
            display: flex;
            list-style: none;
            gap: 2rem; /* Keeps an even, clean space between every item */
            margin: 0;
            padding: 0;
            align-items: center; /* FORCE: Automatically locks plain text links and the button onto the exact same vertical center line */
        }

            nav ul li {
                display: flex;
                align-items: center; /* Ensures the item container itself doesn't introduce vertical alignment drift */
            }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }
    .logo img {
        height: 70px; /* Instantly snaps smaller to leave room for the nav links on phones */
    }
}
/* ==========================================================================
   9. TAMAR PORTAL & DASHBOARD LAYOUTS
   ========================================================================== */
.dashboard-container, .container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

    .dashboard-container h2, .container h1 {
        font-size: 2.2rem;
        color: #ffffff;
        margin-bottom: 1.5rem;
    }

/* Transform all raw forms into luxury dark inputs */
form {
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
}

    form label {
        display: block;
        color: var(--text-muted);
        font-size: 0.9rem;
        font-weight: 600;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    form input[type="text"],
    form input[type="email"],
    form input[type="password"],
    form input[type="date"],
    form select {
        background-color: #05070c !important; /* Forces dark input override */
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        color: #ffffff !important;
        font-size: 1rem;
        font-family: inherit;
        transition: var(--transition);
        box-sizing: border-box;
    }

        form input:focus, form select:focus {
            outline: none !important;
            border-color: var(--accent) !important;
            box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
        }

    /* Style Buttons Universally */
    /* Style Buttons Universally inside Forms */
    form button[type="submit"] {
        background: var(--accent) !important;
        color: #090d16 !important;
        font-weight: 700;
        font-size: 1rem;
        line-height: 1.4; /* Adds clear breathing room inside the box */
        border-radius: 8px !important;
        border: none !important;
        /* Increased padding here to prevent any edge clipping */
        padding: 14px 28px !important;
        transition: var(--transition);
        margin-top: 1.5rem;
        cursor: pointer;
    }

        form button[type="submit"]:hover {
            background: var(--accent-hover) !important;
            color: #ffffff !important;
        }

/* ==========================================================================
   10. BACKEND COMPONENT TABLES & LISTS ({bookings_html} / {matrix_rows})
   ========================================================================== */
/* Admin Time Slot Lists */
.container ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

    .container ul li {
        background-color: #05070c;
        border: 1px solid var(--border-color);
        padding: 1rem;
        border-radius: 8px;
        color: #ffffff;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

/* Dynamic Tables styling for Scheduled Jobs */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #05070c !important;
    color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--border-color);
    color: #ffffff;
    font-weight: 600;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   11. PREMIUM GRID PROFILE FORM
   ========================================================================== */
.profile-card {
    background: #111c24;
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    max-width: 550px;
    margin-top: 1.5rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

    .profile-grid label {
        color: #ffffff;
        font-weight: 600;
        font-size: 0.95rem;
        margin: 0; /* Clear previous form defaults */
        text-transform: none; /* Keep labels natural instead of all caps */
    }

    .profile-grid input {
        width: 100%;
        padding: 10px;
        background: #0b1116 !important;
        border: 1px solid var(--border-color) !important;
        color: #ffffff !important;
        border-radius: 6px;
        box-sizing: border-box;
    }

/* Offset the button container to align perfectly with the inputs */
.profile-action-row {
    margin-left: 130px;
}

/* ==========================================================================
   12. PREMIUM APPOINTMENT BOOKING FORM
   ========================================================================== */
.booking-card {
    background: #111c24;
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    max-width: 550px;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
}

.booking-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

    .booking-grid label {
        color: #ffffff;
        font-weight: 600;
        font-size: 0.95rem;
        margin: 0;
        text-transform: none;
    }

    .booking-grid input[type="text"],
    .booking-grid input[type="date"],
    .booking-grid select {
        width: 100%;
        padding: 10px;
        background: #0b1116 !important;
        border: 1px solid var(--border-color) !important;
        color: #ffffff !important;
        border-radius: 6px;
        box-sizing: border-box;
        font-family: inherit;
        font-size: 1rem;
    }

/* Legal terms segment block */
.booking-legal-container {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legal-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-body);
    font-size: 0.88rem;
    line-height: 1.4;
}

    .legal-row input[type="checkbox"] {
        margin-top: 3px;
        transform: scale(1.1);
        cursor: pointer;
    }

/* Offset button row to line up with inputs */
.booking-action-row {
    margin-left: 130px;
}

/* ==========================================================================
   13. COOKIE CONSENT BANNER
   ========================================================================== */
.cookie-banner {
    position: fixed;
    bottom: -100px; /* Start hidden off-screen */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: #111c24;
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    transition: bottom 0.4s ease-in-out;
}

    .cookie-banner.show {
        bottom: 20px; /* Slide up smoothly */
    }

.cookie-text {
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.4;
    margin: 0;
}

    .cookie-text a {
        color: #38bdf8;
        text-decoration: underline;
    }

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-cookie-accept {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
}

.btn-cookie-decline {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #334455;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}
/* ==========================================================================
   14. HOMEPAGE CONTENT ALIGNMENT
   ========================================================================== */
.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers items horizontally in the flex column */
    justify-content: center; /* Centers items vertically if needed */
    text-align: center; /* Centers all plain text lines */
    padding: 80px 20px;
    max-width: 800px;
    margin: 0 auto !important; /* Forces the block itself to sit center */
    width: 100%;
}

    .home-hero h1 {
        font-size: 3rem;
        margin-bottom: 1.5rem;
        color: #ffffff;
    }

    .home-hero p {
        font-size: 1.2rem;
        color: var(--text-muted);
        max-width: 600px;
        margin-bottom: 2rem;
    }

/* Line up your action buttons side-by-side and centered */
.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* Keeps it clean on mobile screens */
}

/* ==========================================================================
   15. PREMIUM BEFORE & AFTER GALLERY GRID (STATIC & FLIP)
   ========================================================================== */
.gallery-wrap-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

.gallery-grid {
    display: grid;
    /* Clean grid that columns automatically down to 1 row on mobile */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    width: 100%;
    margin: 40px auto;
    justify-content: center;
    justify-items: center;
}

.gallery-item {
    background: #05070c; /* High-contrast clean dark card */
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    width: 100%;
    max-width: 360px; /* Constrains card bounds to stay centered */
    box-sizing: border-box;
}

    .gallery-item:hover {
        border-color: var(--accent);
        transform: translateY(-2px);
    }

/* --- Responsive 3D Flip Card Container --- */
.flip-card-container {
    width: 100%;
    aspect-ratio: 3 / 2;
    perspective: 1000px;
    -webkit-perspective: 1000px;
    margin: 0 auto;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

/* Handles desktop hover flip AND mobile touch toggle flipped state */
.flip-card-container:hover .flip-card-inner,
.flip-card-container.flipped .flip-card-inner {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Stops content bleed during rotation */
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

    .flip-card-front img, .flip-card-back img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.flip-card-back {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}

/* Badges */
.gallery-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    color: white;
    font-weight: bold;
    font-size: 0.75rem;
    border-radius: 4px;
    letter-spacing: 1px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    z-index: 2;
    text-transform: uppercase;
}

.before-badge {
    background: #dc3545;
}

.after-badge {
    background: #28a745;
}

/* Text elements below the card */
.gallery-info h3 {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin: 5px 0 0 0;
}
