/* ============================================
   PATAGONIA TORRES CONTRATAS S.L.
   Custom Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@200;300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

/* --- CSS Custom Properties --- */
:root {
    --brand-blue: #0f172a;
    --brand-gold: #c29a5b;
    --brand-gold-dark: #b1894a;
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base --- */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #ffffff;
}

.serif {
    font-family: 'Playfair Display', serif;
}

/* --- Navegacion Glass Effect --- */
.glass-nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--brand-gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* --- Logo --- */
.logo-svg {
    transition: transform 0.3s ease;
}

.logo-group:hover .logo-svg {
    transform: scale(1.05);
}

/* --- Botones con efecto float --- */
.btn-float {
    transition: all 0.3s var(--transition-ease);
}

.btn-float:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
                0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* --- Hero Video Background --- */
.hero-video-container {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.hero-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(248, 250, 252, 1) 0%,
        rgba(248, 250, 252, 0.85) 30%,
        rgba(248, 250, 252, 0.3) 60%,
        transparent 100%
    );
}

@media (max-width: 1023px) {
    .hero-video-overlay {
        background: linear-gradient(
            to bottom,
            rgba(248, 250, 252, 0.95) 0%,
            rgba(248, 250, 252, 0.7) 50%,
            rgba(248, 250, 252, 0.9) 100%
        );
    }
}

/* --- Menu Movil --- */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.4s var(--transition-ease);
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-menu-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

/* --- Seccion Publicidad (Video Cards) --- */
.video-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: #000;
    aspect-ratio: 9 / 16;
    cursor: pointer;
}

.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--transition-ease);
}

.video-card:hover video {
    transform: scale(1.02);
}

.video-card .play-indicator {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-card .play-indicator.hidden {
    opacity: 0;
}

/* --- Seccion Obras (Galeria Publica) --- */
.obra-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    transition: all 0.3s var(--transition-ease);
}

.obra-card:hover {
    border-color: var(--brand-gold);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.obra-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f1f5f9;
}

.obra-card-media img,
.obra-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--transition-ease);
}

.obra-card:hover .obra-card-media img,
.obra-card:hover .obra-card-media video {
    transform: scale(1.05);
}

/* Filtros de categoria */
.obra-filter {
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.obra-filter:not(.active):hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

.obra-filter.active {
    background-color: var(--brand-blue) !important;
    color: white !important;
}

/* --- Scroll suave para anclas --- */
html {
    scroll-behavior: smooth;
}

section[id] {
    scroll-margin-top: 6.5rem;
}

/* --- Animaciones de entrada (Intersection Observer) --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delay escalonado para items de grid */
.fade-in-up:nth-child(2) { transition-delay: 0.1s; }
.fade-in-up:nth-child(3) { transition-delay: 0.2s; }
.fade-in-up:nth-child(4) { transition-delay: 0.3s; }

/* Nav link activo */
.nav-link.active {
    color: #0f172a !important;
}

/* --- Boton flotante WhatsApp --- */
.whatsapp-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 90;
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s var(--transition-ease);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

.whatsapp-float .pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #25d366;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* --- Admin Panel Styles --- */
.admin-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.admin-dashboard {
    min-height: 100vh;
    background: #f8fafc;
}

.admin-sidebar {
    width: 280px;
    background: var(--brand-blue);
    color: white;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
}

.admin-main {
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
}

@media (max-width: 1023px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 100;
        transition: transform 0.3s ease;
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
}

.admin-nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* --- Upload area (drag & drop) --- */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--brand-gold);
    background: rgba(194, 154, 91, 0.05);
}

/* --- Loading Spinner --- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--brand-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Toast Notifications --- */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 500;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s var(--transition-ease);
    max-width: 350px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }
