/**
 * ArturDevs - Estilos principales
 * Landing Page con Material Design
 * @version 1.0.0
 */

/* ==========================================================================
   CSS Variables - Design Tokens
   ========================================================================== */
:root {
    /* Google Material Dark Palette (Default) */
    --md-bg: #202124;
    --md-surface: #303134;
    --md-surface-2: #3C4043;
    --md-primary: #8AB4F8;
    --md-on-primary: #202124;
    --md-secondary: #81C995;
    --md-accent: #FDD663;
    --md-error: #F28B82;
    --text-high: #E8EAED;
    --text-med: #BDC1C6;
    --text-low: #9AA0A6;
    --line: #5F6368;
    --radius-btn: 50px;
    --radius-card: 24px;
    --font-stack: 'Roboto', sans-serif;
    --pad: clamp(16px, 5vw, 24px);
    --max-w: 1100px;
}

/* Light Mode Overrides */
body.light-mode {
    --md-bg: #FFFFFF;
    --md-surface: #F1F3F4;
    --md-surface-2: #E8EAED;
    --md-primary: #1A73E8;
    --md-on-primary: #FFFFFF;
    --text-high: #202124;
    --text-med: #5F6368;
    --text-low: #70757A;
    --line: #DADCE0;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-stack);
    background-color: var(--md-bg);
    color: var(--text-high);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(138, 180, 248, 0.08), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(129, 201, 149, 0.05), transparent 40%);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 500;
    letter-spacing: -0.5px;
}

p {
    margin: 0 0 16px;
    color: var(--text-med);
    font-size: 16px;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
}

.grid {
    display: grid;
    gap: 16px;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.center {
    text-align: center;
}

.hidden-mobile {
    display: none;
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }
}

.text-primary {
    color: var(--md-primary);
}

/* ==========================================================================
   Section Titles
   ========================================================================== */
.section-title {
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 32px;
    margin-bottom: 12px;
}

/* ==========================================================================
   Process Stepper
   ========================================================================== */
.step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.step-num {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--md-surface-2);
    color: var(--md-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    height: 48px;
    border-radius: var(--radius-btn);
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--md-primary);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn.filled {
    background: var(--md-primary);
    color: var(--md-on-primary);
    border: none;
}

.btn.filled:hover {
    filter: brightness(1.1);
}

.btn.tonal {
    background: rgba(138, 180, 248, 0.12);
    border: none;
}

.btn.full {
    width: 100%;
}

/* ==========================================================================
   Header
   ========================================================================== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--md-bg);
    opacity: 0.98;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.nav {
    justify-content: space-between;
}

.brand {
    font-size: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    color: var(--md-primary);
    font-weight: 900;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: clamp(36px, 8vw, 64px);
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero h1 span {
    color: var(--md-primary);
}

/* ==========================================================================
   Pills & Badges
   ========================================================================== */
.pill {
    background: var(--md-surface-2);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--line);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--md-surface);
    border-radius: var(--radius-card);
    padding: 24px;
    border: 1px solid var(--line);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Responsive Grids
   ========================================================================== */
.cols-2,
.cols-3 {
    display: grid;
    gap: 16px;
}

@media (min-width: 768px) {
    .cols-2 {
        grid-template-columns: 1fr 1fr;
    }

    .cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   Floating Buttons (WhatsApp & Telegram)
   ========================================================================== */
.floating-container {
    position: fixed;
    bottom: 30px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s;
}

.float-btn:hover {
    transform: scale(1.1);
}

.whatsapp {
    background-color: #25d366;
}

.telegram {
    background-color: #0088cc;
}

/* Wave animation */
.wave {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.6;
    z-index: -1;
    animation: pulse-wave 2s infinite;
}

@keyframes pulse-wave {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--md-bg);
    width: 100%;
    max-width: 650px;
    border-radius: 28px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   Calendar
   ========================================================================== */
.calendar-day-btn {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

/* Estado: Ocupado */
.calendar-day-busy {
    background: rgba(242, 139, 130, 0.15);
    color: var(--md-error);
    border: 1px solid var(--md-error);
}

/* Estado: Disponible */
.calendar-day-available {
    background: var(--md-surface-2);
    color: var(--text-high);
}

.calendar-day-available:hover {
    background: var(--md-primary);
    color: var(--md-on-primary);
}

/* Estado: Día Pasado */
.calendar-day-past {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
    color: var(--text-low);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-med);
}

input,
select,
textarea {
    width: 100%;
    background: var(--md-surface-2);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--text-high);
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--md-primary);
    box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
}

/* ==========================================================================
   Theme Switcher
   ========================================================================== */
#themeToggle {
    background: var(--md-surface-2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--md-primary);
    transition: transform 0.2s;
}

#themeToggle:hover {
    transform: rotate(20deg);
}

/* ==========================================================================
   CTA Buttons Row
   ========================================================================== */
.cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    max-width: 640px;
}

.cta-btn {
    height: 56px;
    flex: 1 1 260px;
    min-width: 260px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    background: #171717;
    padding: 40px 0 100px;
    font-size: 14px;
    color: var(--text-low);
}

/* ==========================================================================
   Code Block (Hero Animation)
   ========================================================================== */
.code-block {
    background: #171717;
    border: 1px solid #333;
    opacity: 0.9;
}

.code-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot.red { background: #F28B82; }
.code-dot.yellow { background: #FDD663; }
.code-dot.green { background: #81C995; }

.code-content {
    font-family: monospace;
    color: #81C995;
    font-size: 14px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 767px) {
    .hero {
        padding: 40px 0 30px;
    }
    
    .cta-btn {
        min-width: 100%;
    }
    
    .floating-container {
        bottom: 20px;
        right: 15px;
    }
    
    .float-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* ==========================================================================
   Tooltips - Definiciones interactivas
   ========================================================================== */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-trigger {
    transition: all 0.2s ease;
}

.tooltip-trigger:hover {
    transform: scale(1.05);
}

.tooltip-box {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 340px;
    max-width: 90vw;
    background: var(--md-surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0;
    margin-top: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.tooltip-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: var(--md-surface-2);
    border-bottom: 1px solid var(--line);
}

.tooltip-header i {
    font-size: 1.1rem;
}

.tooltip-header strong {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-high);
}

.tooltip-close {
    background: none;
    border: none;
    color: var(--text-med);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
    display: none;
}

.tooltip-close:hover {
    color: var(--md-error);
}

.tooltip-box p {
    padding: 15px;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-med);
    margin: 0;
}

/* Flecha del tooltip */
.tooltip-box::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 30px;
    width: 16px;
    height: 16px;
    background: var(--md-surface-2);
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    transform: rotate(45deg);
}

/* Desktop con hover real: mostrar al pasar el mouse */
@media (hover: hover) and (pointer: fine) {
    .tooltip-wrapper:hover .tooltip-box {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    /* Ajuste para el segundo tooltip */
    .tooltip-wrapper:last-child .tooltip-box {
        left: auto;
        right: 0;
    }
    
    .tooltip-wrapper:last-child .tooltip-box::before {
        left: auto;
        right: 30px;
    }
}

/* Mobile/Tablet: mostrar botón cerrar y click para activar */
@media (hover: none), (pointer: coarse) {
    .tooltip-close {
        display: block;
    }
    
    .tooltip-box {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        width: 90%;
        max-width: 360px;
        margin-top: 0;
        opacity: 0;
        visibility: hidden;
    }
    
    .tooltip-box.active {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .tooltip-box::before {
        display: none;
    }
    
    /* Overlay para móvil */
    .tooltip-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .tooltip-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}
