/* --- Variables & Theme --- */
:root {
    --bg-body: #0a0a0a;
    --bg-card: #141414;
    --bg-nav: rgba(10, 10, 10, 0.85);
    /* Glass effect */

    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;

    --accent: #e74c3c;
    /* Racing Red */
    --accent-hover: #c0392b;
    --accent-glow: rgba(231, 76, 60, 0.4);

    --border: #333;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

    --font-main: 'Outfit', sans-serif;

    --transition: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-main);
    color: var(--text-main);
    line-height: 1.6;
    padding-top: 80px;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 3rem;
    line-height: 1.1;
    text-transform: uppercase;
}

h2 {
    font-size: 2rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent);
    margin-top: 5px;
    border-radius: 2px;
}

/* --- Buttons --- */
button {
    font-family: var(--font-main);
    cursor: pointer;
    border: none;
}

.btn-auth,
.btn-action,
.btn-nav-admin {
    background: linear-gradient(135deg, var(--accent) 0%, #c0392b 100%);
    color: #fff;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.3s var(--transition);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-auth:hover,
.btn-action:hover,
.btn-nav-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
    filter: brightness(1.1);
}


.btn-auth.logout {
    background: #333;
    box-shadow: none;
}

.btn-auth.logout:hover {
    background: #444;
}

.btn-auth-small {
    background: #444;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    margin-left: 5px;
}

.btn-auth-small:hover {
    background: var(--accent);
    transform: scale(1.1);
}

.admin-btns-car {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px;
    border-radius: 8px;
    display: flex;
    gap: 5px;
}


/* --- Navbar (Glassmorphism) --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    padding: 15px 0;
    transition: 0.3s;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: 0.3s var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Language Switcher */
.language-switcher {
    background: #222;
    padding: 4px;
    border-radius: 30px;
    display: flex;
}

.btn-lang {
    background: transparent;
    color: #666;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-lang.active {
    background: #444;
    color: #fff;
}

/* --- Header / Hero --- */
header {
    height: 25vh;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #000;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('logo.png') center/cover no-repeat;
    opacity: 0.3;
    transform: scale(1.1);
    filter: blur(5px);
    animation: zoomSlow 20s infinite alternate;
}

header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 0%, var(--bg-body) 90%);
}

@keyframes zoomSlow {
    from {
        transform: scale(1.1);
    }

    to {
        transform: scale(1.2);
    }
}

.hero {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 2rem;
    background: -webkit-linear-gradient(#fff, #999);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Layout --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

section {
    margin: 80px 0;
}

/* --- Cards & Services --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: var(--radius);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: rgba(231, 76, 60, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #fff;
}

.service-card p {
    color: var(--text-muted);
}

/* --- Project Gallery (Grid) --- */
.gallery-grid,
#userGallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    height: 450px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
    position: relative;
}

.project-card-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.project-slider-wrapper {
    height: 280px;
    overflow: hidden;
    position: relative;
}

.project-slider-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.project-card-container:hover .project-slider-wrapper img {
    transform: scale(1.05);
}

.project-title-footer {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-title-footer h2 {
    font-size: 1.2rem;
    margin: 0;
    color: #fff;
}

.project-title-footer p {
    font-size: 1.25rem;
    color: var(--accent);
    font-weight: 700;
    margin-top: 5px;
}

/* Status Badges */
.sold-badge {
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    position: absolute;
    top: 20px;
    right: 20px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.project-card-container.sold-out img {
    filter: grayscale(100%) contrast(1.2);
    opacity: 0.6;
}

/* --- Admin Area --- */
#admin-upload-zone {
    background: #1a1a1a;
    border: 1px dashed #444;
    border-radius: var(--radius);
    padding: 40px;
    margin-bottom: 50px;
}

.admin-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.thumb-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
}

.thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #444;
}

.btn-remove-thumb {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: #fff;
    border: 2px solid #1a1a1a;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s;
    line-height: 1;
}

.btn-remove-thumb:hover {
    background: #c0392b;
    transform: scale(1.1);
}


.admin-sub-section h2,
.admin-sub-section h3 {
    color: #fff;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

#invoice-items-container th {
    color: #111 !important;
    font-weight: 800;
}


.upload-box {
    border: 2px dashed #444;
    background: #111;
    padding: 40px;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.upload-box:hover {
    border-color: var(--accent);
    background: #161616;
}

.upload-box p {
    color: #888;
    font-weight: 600;
}

.input-field {
    width: 100%;
    padding: 15px;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    font-family: inherit;
    transition: 0.3s;
}

.input-field:focus {
    border-color: var(--accent);
    background: #161616;
}

/* --- Viewer Modal --- */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
}

.viewer-side {
    background: transparent;
    border: none;
}

.viewer-label {
    color: var(--accent);
    letter-spacing: 2px;
    font-weight: 700;
}

/* --- Login Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}


.close-modal,
.close-viewer-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.2rem;
    line-height: 1;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.close-modal:hover,
.close-viewer-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: rotate(90deg);
}


/* --- Contact Section --- */
.contact-vertical-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.map-container-movible {
    height: 100%;
    min-height: 400px;
}

.contact-info-centered {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
}

.info-block p strong {
    color: #fff;
    display: block;
    margin-bottom: 5px;
}

.info-block p {
    color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    /* Mobile Menu would be needed, hiding for now or keeping simplified */
    .contact-vertical-container {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 40px;
    }

    /* Simple Mobile Nav Fix */
    .nav-flex {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }

    .nav-links {
        display: flex;
        gap: 15px;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 10px;
        justify-content: center;
    }

    .nav-links a {
        font-size: 0.8rem;
    }
}

/* Utilities */
.text-en {
    display: block;
}

.text-es {
    display: none;
}

body.espanol .text-es {
    display: block;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    background: #202020;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast-notification.error {
    border-left-color: #e74c3c;
}

.toast-notification.success {
    border-left-color: #2ecc71;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Slider & Viewer Navigation Buttons --- */
.slider-btn,
.viewer-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 60px;
    /* Increased size */
    height: 60px;
    /* Increased size */
    border-radius: 50%;
    font-size: 2rem;
    /* Increased size */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.slider-btn:hover,
.viewer-nav-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn.prev {
    left: 20px;
}

.slider-btn.next {
    right: 20px;
}

/* Ensure slider container has relative positioning for absolute buttons */
.slider-wrapper {
    position: relative;
    padding: 0 40px;
    /* Space for buttons */
}

/* --- Slider Flex Fix --- */
.slider-container {
    display: flex !important;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    padding-bottom: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.slider-container .project-card-container {
    min-width: 300px;
}

/* --- Viewer & Button Refinements --- */
/* Force buttons to be on the far sides of the viewer */
.image-viewer .viewer-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    font-size: 2rem;
    z-index: 3001;
    /* Above image */
}

.image-viewer .viewer-nav-btn.prev {
    left: 40px;
    right: auto;
}

.image-viewer .viewer-nav-btn.next {
    right: 40px;
    left: auto;
}

/* Increase Image Size in Viewer */
.viewer-comparison-container {
    width: 90% !important;
    max-width: 1600px !important;
    height: 85vh !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.viewer-side {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.viewer-side img {
    max-width: 100%;
    max-height: 80vh !important;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

/* --- Refined Premium Login --- */
.modal-content {
    background: rgba(20, 20, 20, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 16px !important;
    padding: 40px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(231, 76, 60, 0.1) !important;
    max-width: 400px;
    width: 90%;
    animation: fadeInScale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content h3 {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-content label {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-content .input-field {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 15px !important;
    color: #fff !important;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-content .input-field:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.2);
}

.modal-content .btn-action {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-size: 1rem;
    letter-spacing: 2px;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Viewer Layout Fix (Equal Sizing) --- */
.viewer-comparison-container {
    width: 95% !important;
    max-width: 1800px !important;
    height: 90vh !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0 !important;
}

.viewer-side {
    flex: 1 1 50% !important;
    width: 50% !important;
    height: 100% !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.viewer-side img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}