/* assets/css/style.css */
/* Premium Design System for Cefalea en Racimos */

:root {
    --primary-dark: #1a3a5f;
    --primary-light: #4a90e2;
    --accent-cyan: #00d4ff;
    --bg-dark: #0f172a;
    --text-white: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Premium Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-light), var(--accent-cyan));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* Typography */
    h1, h2, h3 {
        margin-bottom: 1.5rem;
        background: linear-gradient(90deg, #fff, var(--accent-cyan));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary-light);
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    outline: none;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    border-color: var(--accent-cyan);
}

select option {
    background-color: #111827; /* Fondo oscuro sólido para que se lean las opciones */
    color: #ffffff !important; /* Texto blanco para asegurar el contraste */
}

/* Checkbox & Radio Alignment */
input[type="checkbox"], input[type="radio"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--accent-cyan);
}

label input[type="checkbox"], label input[type="radio"] {
    display: inline-block;
    vertical-align: middle;
}

.checkbox-group label, .radio-group label, .check-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 8px;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s;
}

.check-container:hover {
    background: rgba(255, 255, 255, 0.08);
}

input[type="checkbox"], input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    margin: 0 10px 0 0 !important;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--accent-cyan);
}

/* Navigation & Sidebar (v5 Robust Visibility) */

/* Forced Legibility for ALL text in navigation and tables */
.nav-link, 
nav ul li a, 
.sidebar a,
h1, h2, h3,
table, th, td {
    color: #ffffff !important;
    text-decoration: none;
    -webkit-text-fill-color: initial !important; /* Reset transparent gradients */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-icon {
    font-size: 1.5rem;
    min-width: 32px;
    text-align: center;
}

/* Mobile Header (Solid Background) */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #0f172a !important; /* Pure solid dark */
    border-bottom: 2px solid #4a90e2; /* Clearer border */
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.mobile-logo {
    height: 40px;
}

.hamburger-btn {
    background: #4a90e2 !important;
    color: #ffffff !important;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 1.6rem;
    cursor: pointer;
    font-weight: 900;
}

/* Sidebar Drawer (Solid Overlay) */
.sidebar {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 60px);
    background: #111827 !important; /* Solid dark grey */
    z-index: 2900;
    transition: left 0.3s ease-in-out;
    padding: 30px;
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.main-content {
    margin-left: 0;
    padding-top: 90px; /* More space for header */
    padding-left: 20px;
    padding-right: 20px;
}

/* Desktop Overrides */
@media (min-width: 992px) {
    .mobile-header {
        display: none;
    }

    .sidebar {
        left: 0 !important;
        top: 0;
        width: 260px;
        height: 100vh;
        border-right: 1px solid var(--glass-border);
        background: rgba(15, 23, 42, 0.95) !important;
        padding: 2rem 1rem;
    }

    .main-content {
        margin-left: 260px;
        padding-top: 2rem;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .logo-container {
        display: block !important;
        text-align: center;
        margin-bottom: 2rem;
    }
}

/* Landscape orientation on mobile - force mobile header off if requested but let's stick to standard breakpoints for stability */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        width: 200px;
        height: 100vh;
        top: 0;
        left: 0;
    }
    .main-content {
        margin-left: 200px;
        padding-top: 1rem;
    }
    .mobile-header {
        display: none;
    }
}

/* Tables & Data Visibility */
.glass {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

table {
    width: 100%;
    border-spacing: 0;
}

th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Dashboard Fixes */
.dashboard-header h1 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.grid-responsive-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

@media (max-width: 600px) {
    .dashboard-header h1 {
        font-size: 1.6rem;
    }
}
/* Quick Attack Recorder */
.quick-record-container {
    margin-bottom: 30px;
    margin-top: 20px;
    text-align: center;
    padding: 60px 40px;
    overflow: visible !important;
}

.recorder-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.btn-recorder {
    width: 100%; /* Full width for the rectangular card look */
    min-height: 180px;
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 30px;
    font-size: 2.5rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    color: white;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
    outline: none;
    margin-top: 10px;
}

.btn-start {
    background: #00c853; /* Strong Green Block */
    box-shadow: 0 15px 35px rgba(0, 200, 83, 0.4);
}

.btn-stop {
    background: #ff1744; /* Strong Red Block */
    box-shadow: 0 15px 35px rgba(255, 23, 68, 0.4);
}

.btn-recorder span:first-child {
    font-size: 4rem;
}

.btn-recorder:hover {
    transform: translateY(-5px);
    filter: brightness(1.1);
}

.btn-recorder:active {
    transform: translateY(2px);
}

.recorder-timer {
    font-size: 6rem;
    font-weight: 900;
    font-family: 'Courier New', Courier, monospace;
    margin: 40px 0;
    color: var(--accent-cyan);
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.quick-record-container h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

#recorder-status {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    font-weight: 500;
    color: #fff;
}

.intensity-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 20px auto;
}

.btn-intensity {
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--glass-border);
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-intensity:hover {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-dark);
    transform: translateY(-3px);
}

@media (max-width: 600px) {
    .quick-record-container {
        padding: 30px 15px;
    }

    .btn-recorder {
        min-height: 140px;
        font-size: 1.8rem;
        gap: 15px;
        width: 100%; /* Ensure it remains full width */
        flex-shrink: 1; /* Allow shrinking if needed, but min-height helps */
    }
    
    .btn-recorder span:first-child {
        font-size: 3rem;
    }

    .recorder-timer {
        font-size: 4.5rem;
        word-break: break-all; /* Keep this for overflow prevention */
    }

    .quick-record-container h2 {
        font-size: 1.8rem;
    }
    
    #recorder-status {
        font-size: 1.1rem;
    }

    .intensity-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .btn-intensity {
        padding: 12px;
        font-size: 1.1rem;
    }
}

/* Loader Animation */
.loader {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--accent-cyan);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Trigger Options */
.btn-trigger-opt {
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-trigger-opt:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-trigger-opt.active {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

#weather_select {
    width: 100%;
    padding: 15px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

/* New Abortive Grid */
.abortive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

/* Efficacy Emojis */
/* Efficacy Emojis */
.efficacy-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.efficacy-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.efficacy-option:hover {
    transform: scale(1.1);
}

.eff-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.eff-blue { background: #3b82f6; }
.eff-red { background: #ef4444; }
.eff-orange { background: #f97316; }
.eff-yellow { background: #eab308; }
.eff-green { background: #22c55e; }

@media (max-width: 480px) {
    .efficacy-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    .eff-icon {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }
}

.efficacy-option span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #eee;
}
.stacked-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-left: 5px;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: white !important;
}

.edit-btn {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid var(--accent-cyan);
}

.edit-btn:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark) !important;
}

.delete-btn {
    background: rgba(255, 23, 68, 0.2);
    border: 1px solid #ff1744;
}

.delete-btn:hover {
    background: #ff1744;
}

#intensityChartContainer {
    width: 100%;
    min-height: 350px;
}

/* --- ROLLER SELECTOR (WHEEL) --- */
.roller-container {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.roller-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.roller-label {
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.roller-window {
    height: 120px;
    width: 70px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: none;
    position: relative;
    -ms-overflow-style: none;
    display: block;
    mask-image: linear-gradient(to bottom, transparent, black 40%, black 60%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%, black 60%, transparent);
}

.roller-window::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.roller-list {
    display: block;
    padding: 40px 0; /* Padding to allow top/bottom items to reach center */
    width: 100%;
}

.roller-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.4);
    scroll-snap-align: center;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.roller-item.active {
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
}

.roller-highlight {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 40px;
    border-top: 2px solid var(--accent-cyan);
    border-bottom: 2px solid var(--accent-cyan);
    pointer-events: none;
    background: rgba(0, 201, 255, 0.05);
}

/* --- DOSAGE FLEXIBILITY --- */
.dosage-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dosage-option {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.dosage-option.selected {
    border-color: var(--accent-cyan);
    background: rgba(0, 201, 255, 0.05);
}

.dosage-input-wrapper {
    display: none;
    margin-top: 5px;
}

.dosage-option.selected .dosage-input-wrapper {
    display: block;
}
