/* --- 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;
    transition: padding-top 0.3s ease;
}

/* Modo admin: navbar necesita más espacio (2 filas) */
body.admin-mode {
    padding-top: 120px;
}

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: 7px 13px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    transition: all 0.3s var(--transition);
    box-shadow: 0 4px 15px var(--accent-glow);
    white-space: nowrap;
}

.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: 10px 0;
    transition: 0.3s;
}

.nav-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Admin nav ocupa fila completa debajo del nav-right */
#nav-links-admin {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    row-gap: 6px;
    column-gap: 6px;
    padding-bottom: 4px;
}

.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);
}

.year-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.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;
}

#year-overlay {
    position: absolute;
    bottom: 20px;
    /* Posicionando abajo */
    left: 50%;
    transform: translateX(-50%);
    width: 18%;
    /* Requerimiento explicito */
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 10px 0;
    text-align: center;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    z-index: 3001;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    /* Que no bloquee clicks */
}

/* Drag and Drop Styles */
.thumb-container {
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.thumb-container.over {
    border: 2px dashed var(--accent);
    transform: scale(1.05);
}

.thumb-container.dragging {
    opacity: 0.4;
}

/* --- 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 --- */

/* Desktop and Large Screens */
@media (min-width: 1400px) {

    .btn-nav-admin,
    .btn-auth {
        font-size: 0.85rem;
        padding: 10px 24px;
    }

    body.admin-mode {
        padding-top: 135px;
    }
}

/* Tablets and Medium Screens */
@media (max-width: 1200px) {
    .nav-flex {
        padding: 0 10px;
    }

    .nav-links {
        gap: 10px;
    }

    .btn-nav-admin,
    .btn-auth {
        font-size: 0.65rem;
        padding: 7px 12px;
    }

    .gallery-grid,
    #userGallery {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Small Tablets */
@media (max-width: 992px) {
    body {
        padding-top: 120px;
    }

    body.admin-mode {
        padding-top: 170px;
    }

    .navbar {
        padding: 8px 0;
    }

    .nav-flex {
        flex-direction: column;
        gap: 8px;
    }

    .nav-links {
        flex-wrap: wrap !important;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }

    #nav-links-admin {
        order: 0;
        justify-content: center;
    }

    .btn-nav-admin,
    .btn-auth {
        font-size: 0.6rem;
        padding: 6px 10px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .contact-vertical-container {
        grid-template-columns: 1fr;
    }

    .gallery-grid,
    #userGallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Mobile Phones */
@media (max-width: 768px) {
    body {
        padding-top: 140px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 15px;
    }

    section {
        margin: 40px 0;
    }

    .navbar {
        padding: 8px 0;
    }

    .nav-flex {
        flex-direction: column;
        padding: 0 10px;
        gap: 8px;
    }

    .nav-links {
        flex-wrap: wrap !important;
        gap: 6px;
        justify-content: center;
    }

    .nav-links a {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .btn-nav-admin,
    .btn-auth {
        font-size: 0.55rem;
        padding: 5px 8px;
    }

    .nav-right {
        gap: 10px;
    }

    .hero {
        padding: 20px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .gallery-grid,
    #userGallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-card-container {
        height: 400px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .upload-box {
        padding: 20px;
    }

    .slider-wrapper {
        padding: 0 10px;
    }

    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .viewer-comparison-container {
        flex-direction: column;
        width: 95% !important;
        height: auto !important;
        gap: 10px !important;
    }

    .viewer-side {
        width: 100% !important;
        height: auto !important;
    }

    .viewer-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .image-viewer .viewer-nav-btn.prev {
        left: 10px;
    }

    .image-viewer .viewer-nav-btn.next {
        right: 10px;
    }
}

/* Small Mobile Phones */
@media (max-width: 480px) {
    body {
        padding-top: 160px;
    }

    .btn-nav-admin,
    .btn-auth {
        font-size: 0.5rem;
        padding: 4px 6px;
    }

    .nav-links {
        gap: 4px;
    }

    .hero h1 {
        font-size: 1.2rem;
    }

    .hero p {
        font-size: 0.8rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .project-card-container {
        height: 350px;
    }

    .modal-content {
        padding: 20px !important;
    }
}

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

.text-es {
    display: none;
}

body.espanol .text-en {
    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;
}

/* ===================================================
   SALES REGISTER MODULE
   =================================================== */

.sale-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #aaa;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Sales Table */
.sales-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.sales-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.sales-table th {
    background: #1a6b3c;
    color: #fff;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #155a31;
}

.sales-table th:first-child {
    border-radius: 0;
    width: 30px;
    text-align: center;
}

.sales-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #222;
    color: #ccc;
    vertical-align: middle;
    white-space: nowrap;
}

.sales-table tbody tr:hover {
    background: #1a1a1a;
}

.sales-table tbody tr:last-child td {
    border-bottom: none;
}

.sales-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badge */
.sale-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Sales total bar */
#sales-total-bar {
    padding: 10px 0;
    border-top: 1px solid #333;
    color: #ccc;
    font-size: 0.9rem;
}

/* Responsive: stack grid on mobile for sale form */
@media (max-width: 900px) {
    #admin-sales [style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 600px) {
    #admin-sales [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}