/* ========================================
   VTV Portal - Estilos Oficiales Clone
   ======================================== */

@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,300&display=swap');
@import url('https://fonts.googleapis.com/css?family=Roboto:400,300,500,700&display=swap');

:root {
    --primary: #1ab394;
    --primary-dark: #18a689;
    --primary-light: #1dc5a3;
    --sidebar-bg: #2f4050;
    --sidebar-hover: #293846;
    --topbar-bg: #ffffff;
    --body-bg: #f3f3f4;
    --text-primary: #676a6c;
    --text-dark: #333333;
    --text-muted: #888888;
    --border-color: #e7eaec;
    --white: #ffffff;
    --panel-primary: #1ab394;
    --info: #23c6c8;
    --success: #1c84c6;
    --warning: #f8ac59;
    --danger: #ed5565;
    --label-info: #23c6c8;
    --label-success: #1ab394;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--body-bg);
    min-height: 100vh;
}

/* HEADER */
.vtv-header {
    background: var(--white);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.vtv-header img {
    max-width: 100%;
    height: auto;
    max-height: 90px;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 90px;
    left: 0;
    width: 220px;
    height: calc(100vh - 90px);
    background: var(--sidebar-bg);
    z-index: 999;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: #a7b1c2;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: var(--sidebar-hover);
    color: var(--white);
    border-left-color: var(--primary);
}

.sidebar-menu li a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* MAIN CONTENT */
.main-content {
    margin-left: 220px;
    margin-top: 90px;
    min-height: calc(100vh - 90px);
}

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-toggle {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
}

.topbar-right a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
}

.topbar-right a:hover {
    color: var(--primary);
}

/* BREADCRUMB */
.breadcrumb-wrapper {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 25px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: 13px;
}

.breadcrumb li a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb li.active {
    color: var(--text-dark);
    font-weight: 600;
}

/* CONTENT */
.content-wrapper {
    padding: 20px 25px;
}

/* PANELS */
.ibox {
    background: var(--white);
    margin-bottom: 25px;
}

.ibox-title {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.ibox-title h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.ibox-content {
    padding: 20px;
}

.panel {
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.panel-primary .panel-heading {
    background: var(--panel-primary);
    color: var(--white);
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 600;
}

.panel-body {
    padding: 15px;
    background: var(--white);
}

/* FORMS */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--white);
    border: 1px solid #e5e6e7;
    border-radius: 1px;
    transition: border-color 0.15s;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

/* Campos readonly estilo oficial VTV (borde izquierdo teal) */
.form-control.readonly,
.field-readonly {
    background: transparent;
    border: none;
    border-left: 3px solid var(--primary);
    padding-left: 10px;
    color: var(--text-primary);
}

select.form-control {
    height: 36px;
    cursor: pointer;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 120px;
}

.input-group {
    display: flex;
}

.input-group-addon {
    padding: 8px 12px;
    background: #eee;
    border: 1px solid #e5e6e7;
    border-right: none;
    font-size: 13px;
}

/* RADIO & CHECKBOX */
.radio-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 20px;
    cursor: pointer;
    font-size: 13px;
}

.radio-inline input[type="radio"] {
    margin: 0;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-info {
    background: var(--info);
    color: var(--white);
    border-color: var(--info);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-white {
    background: var(--white);
    color: var(--text-dark);
    border-color: #e7eaec;
}

.btn-white:hover {
    background: #f8f8f8;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* BOTON SOLICITAR TURNO - MUY VISIBLE */
.btn-solicitar {
    background: linear-gradient(135deg, #1ab394 0%, #18a689 100%);
    color: var(--white) !important;
    border: 2px solid #1ab394;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(26, 179, 148, 0.4);
    transition: all 0.3s ease;
    animation: pulseBtn 2s infinite;
}

.btn-solicitar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 179, 148, 0.5);
    background: linear-gradient(135deg, #18a689 0%, #159c7d 100%);
}

@keyframes pulseBtn {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(26, 179, 148, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(26, 179, 148, 0.6);
    }
}

/* TABLES */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table thead th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    border: none;
}

.table tbody tr:hover {
    background: #fafafa;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions a,
.table-actions button {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 2px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* LABELS */
.label {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 2px;
}

.label-info {
    background: var(--label-info);
    color: var(--white);
}

.label-success {
    background: var(--label-success);
    color: var(--white);
}

.label-warning {
    background: var(--warning);
    color: var(--white);
}

.label-danger {
    background: var(--danger);
    color: var(--white);
}

/* ALERTS */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 3px;
}

.alert-success {
    background: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.alert-info {
    background: #d9edf7;
    color: #31708f;
    border: 1px solid #bce8f1;
}

.alert-warning {
    background: #fcf8e3;
    color: #8a6d3b;
    border: 1px solid #faebcc;
}

.alert-danger {
    background: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* ADVERTENCIA DE COBRO */
.advertencia-cobro {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 1px solid #f0d98a;
    border-left: 4px solid #f8ac59;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.advertencia-cobro-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.advertencia-cobro-header i {
    font-size: 24px;
    color: #d4870e;
}

.advertencia-cobro-header h4 {
    margin: 0;
    color: #8a6d3b;
    font-size: 15px;
    font-weight: 700;
}

.advertencia-cobro p {
    color: #8a6d3b;
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.advertencia-cobro .checkbox-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    cursor: pointer;
}

.advertencia-cobro .checkbox-terms input {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.advertencia-cobro .checkbox-terms span {
    font-size: 13px;
    color: #5a4a2a;
    font-weight: 600;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: 3px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* HORARIOS GRID */
.horarios-section {
    margin-bottom: 15px;
}

.horarios-title {
    background: var(--primary);
    color: var(--white);
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 600;
}

.horarios-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-top: none;
}

.horario-btn {
    padding: 8px 12px;
    font-size: 12px;
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 60px;
    text-align: center;
}

.horario-btn:hover {
    background: var(--primary-light);
    color: var(--white);
    border-color: var(--primary);
}

.horario-btn.selected {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.horario-btn.disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

/* FECHA LEYENDA */
.fecha-leyenda {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 12px;
}

.fecha-leyenda span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.leyenda-box {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.leyenda-box.disponible {
    background: var(--label-info);
}

.leyenda-box.seleccionado {
    background: var(--label-success);
}

/* CARD PREVIEW */
.card-preview {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 12px;
    padding: 25px;
    color: var(--white);
    margin-bottom: 20px;
    aspect-ratio: 1.6;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-chip {
    width: 45px;
    height: 32px;
    background: linear-gradient(135deg, #ffd700 0%, #daa520 50%, #ffd700 100%);
    border-radius: 5px;
}

.card-number {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    letter-spacing: 3px;
    margin: 20px 0;
}

.card-details {
    display: flex;
    justify-content: space-between;
}

.card-detail label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 3px;
}

.card-detail span {
    font-size: 14px;
    text-transform: uppercase;
}

/* LOADING */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 15px;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #eee;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 14px;
    color: var(--text-dark);
}

/* FOOTER */
.vtv-footer {
    background: var(--sidebar-bg);
    color: #a7b1c2;
    padding: 15px 25px;
    text-align: center;
    font-size: 12px;
    margin-left: 220px;
}

/* TWO COLUMN LAYOUT */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 1024px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content,
    .vtv-footer {
        margin-left: 0;
    }

    .form-row {
        flex-direction: column;
    }

    .horarios-grid {
        gap: 5px;
    }

    .horario-btn {
        min-width: 50px;
        padding: 6px 8px;
        font-size: 11px;
    }

    /* Botón Solicitar turno ULTRA VISIBLE en móvil */
    .btn-solicitar {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        margin-bottom: 10px;
        animation: pulseBtnMobile 1.5s infinite;
    }

    @keyframes pulseBtnMobile {

        0%,
        100% {
            box-shadow: 0 4px 15px rgba(26, 179, 148, 0.4);
            transform: scale(1);
        }

        50% {
            box-shadow: 0 6px 30px rgba(26, 179, 148, 0.7);
            transform: scale(1.02);
        }
    }
}