/* ===================================
   FULLCALENDAR MODERN DESIGN - TAXES SOFTWARE
   =================================== */

/* Variables CSS para consistencia */
:root {
    --fc-primary: #2563eb;
    --fc-primary-light: #3b82f6;
    --fc-primary-dark: #1d4ed8;
    --fc-secondary: #64748b;
    --fc-success: #10b981;
    --fc-warning: #f59e0b;
    --fc-danger: #ef4444;
    --fc-white: #ffffff;
    --fc-gray-50: #f8fafc;
    --fc-gray-100: #f1f5f9;
    --fc-gray-200: #e2e8f0;
    --fc-gray-300: #cbd5e1;
    --fc-gray-400: #94a3b8;
    --fc-gray-500: #64748b;
    --fc-gray-600: #475569;
    --fc-gray-700: #334155;
    --fc-gray-800: #1e293b;
    --fc-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --fc-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --fc-radius: 0.5rem;
    --fc-radius-lg: 0.75rem;
}

/* Container principal del calendario */
.taxes-calendar-container {
    padding: 1rem;
    background: var(--fc-gray-50);
    min-height: 100vh;
}

.taxes-calendar-wrapper {
    border-radius: var(--fc-radius-lg);
    overflow: hidden;
    box-shadow: var(--fc-shadow);
    background: var(--fc-white);
    transition: all 0.3s ease;
}

.taxes-calendar-wrapper:hover {
    box-shadow: var(--fc-shadow-hover);
}

.taxes-service-card {
    border: 1px solid var(--fc-gray-200);
    border-radius: var(--fc-radius-lg);
    background: var(--fc-white);
}

.taxes-service-header {
    background: linear-gradient(135deg, var(--fc-gray-50) 0%, var(--fc-gray-100) 100%);
    border-bottom: 2px solid var(--fc-gray-200);
    border-radius: var(--fc-radius-lg) var(--fc-radius-lg) 0 0;
    padding: 1.5rem;
}

.taxes-pending-card {
    border-left: 4px solid var(--fc-warning);
    border-radius: var(--fc-radius-lg);
    background: var(--fc-white);
}

.taxes-calendar-main {
    padding: 1rem;
}

.taxes-calendar-header {
    background: linear-gradient(135deg, #eff6ff 0%, var(--fc-gray-50) 100%);
    border-bottom: 2px solid #dbeafe;
    padding: 1.25rem;
    border-radius: var(--fc-radius) var(--fc-radius) 0 0;
}

.taxes-btn-modern {
    border-radius: 0.375rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    border: none;
}

.taxes-btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ===== FULLCALENDAR CORE STYLING ===== */

/* Resetear estilos base */
.fc {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: var(--fc-white);
    border: none;
}

/* HEADER DEL CALENDARIO */
.fc-header-toolbar {
    padding: 1rem 1.5rem !important;
    background: linear-gradient(135deg, var(--fc-primary) 0%, var(--fc-primary-dark) 100%) !important;
    border-radius: var(--fc-radius) var(--fc-radius) 0 0 !important;
    margin-bottom: 0 !important;
    border: none !important;
}

.fc-toolbar-title {
    color: var(--fc-white) !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    margin: 0 !important;
}

/* BOTONES DEL HEADER */
.fc-button-group {
    position: relative;
}

.fc-button-group .fc-button,
.fc-button {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: var(--fc-white) !important;
    border-radius: 0.375rem !important;
    padding: 0.5rem 0.75rem !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    transition: all 0.2s ease !important;
    margin: 0 0.125rem !important;
    text-transform: none !important;
    box-shadow: none !important;
}

.fc-button:hover,
.fc-button:focus {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    color: var(--fc-white) !important;
}

.fc-button-active,
.fc-button-active:hover,
.fc-button-active:focus {
    background: var(--fc-white) !important;
    color: var(--fc-primary) !important;
    border-color: var(--fc-white) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transform: none !important;
}

.fc-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* VISTA DEL CALENDARIO */
.fc-view-harness {
    background: var(--fc-white);
    border-radius: 0 0 var(--fc-radius) var(--fc-radius);
}

/* ENCABEZADOS DE DÍAS */
.fc-col-header {
    background: linear-gradient(135deg, var(--fc-gray-50) 0%, var(--fc-gray-100) 100%);
    border-bottom: 2px solid var(--fc-gray-200);
    border-top: none;
}

.fc-col-header-cell {
    padding: 0.75rem 0.5rem;
    border-left: none;
    border-right: 1px solid var(--fc-gray-200);
}

.fc-col-header-cell:first-child {
    border-left: none;
}

.fc-col-header-cell:last-child {
    border-right: none;
}

.fc-col-header-cell-cushion {
    color: var(--fc-gray-700) !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-decoration: none !important;
}

/* CELDAS DE DÍAS */
.fc-daygrid-day {
    background: var(--fc-white);
    border-left: none;
    border-right: 1px solid var(--fc-gray-200);
    border-bottom: 1px solid var(--fc-gray-200);
    transition: background-color 0.2s ease;
    min-height: 120px;
}

.fc-daygrid-day:first-child {
    border-left: none;
}

.fc-daygrid-day:last-child {
    border-right: none;
}

.fc-daygrid-day:hover {
    background: var(--fc-gray-50);
}

.fc-daygrid-day-frame {
    position: relative;
    min-height: 100%;
}

.fc-daygrid-day-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
}

.fc-daygrid-day-number {
    color: var(--fc-gray-700) !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 0.25rem !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    margin: 0 !important;
}

.fc-daygrid-day-number:hover {
    background: #dbeafe !important;
    color: var(--fc-primary-dark) !important;
}

/* DÍA ACTUAL */
.fc-day-today {
    background: rgba(37, 99, 235, 0.05) !important;
}

.fc-day-today .fc-daygrid-day-number {
    background: var(--fc-primary) !important;
    color: var(--fc-white) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

/* DÍAS DE OTROS MESES */
.fc-day-other {
    background: #fafafa;
}

.fc-day-other .fc-daygrid-day-number {
    color: var(--fc-gray-400) !important;
}

/* EVENTOS */
.fc-event {
    border: none !important;
    border-radius: 0.375rem !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0.125rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    font-size: 0.75rem !important;
    backdrop-filter: blur(10px);
}

.fc-event:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 10;
}

.fc-event-main {
    padding: 0;
}

.fc-event-title {
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.fc-event-time {
    font-weight: 500 !important;
    font-size: 0.625rem !important;
    opacity: 0.9 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* VISTA DE SEMANA Y DÍA */
.fc-timegrid-slot {
    border-color: var(--fc-gray-200);
    height: 3rem;
    border-bottom: 1px solid var(--fc-gray-100);
}

.fc-timegrid-slot-minor {
    border-color: var(--fc-gray-100);
    border-bottom-style: dotted;
}

.fc-timegrid-axis {
    background: var(--fc-gray-50);
    border-color: var(--fc-gray-200);
    color: var(--fc-gray-600);
    font-weight: 600;
    font-size: 0.75rem;
    border-right: 2px solid var(--fc-gray-200);
}

.fc-timegrid-axis-cushion {
    padding: 0 0.5rem;
}

.fc-timegrid-col {
    border-color: var(--fc-gray-200);
}

.fc-timegrid-col:not(:last-child) {
    border-right: 1px solid var(--fc-gray-200);
}

/* ÁREA DE SELECCIÓN */
.fc-highlight {
    background: rgba(37, 99, 235, 0.1) !important;
    border-radius: 0.375rem;
}

/* LÍNEA DE TIEMPO ACTUAL */
.fc-timegrid-now-indicator-line {
    border-color: var(--fc-danger);
    border-width: 2px;
}

.fc-timegrid-now-indicator-arrow {
    border-left-color: var(--fc-danger);
    border-right-color: var(--fc-danger);
}

/* SCROLLBAR PERSONALIZADO */
.fc-scroller {
    scrollbar-width: thin;
    scrollbar-color: var(--fc-gray-300) var(--fc-gray-100);
}

.fc-scroller::-webkit-scrollbar {
    width: 8px;
}

.fc-scroller::-webkit-scrollbar-track {
    background: var(--fc-gray-100);
    border-radius: 0.25rem;
}

.fc-scroller::-webkit-scrollbar-thumb {
    background: var(--fc-gray-300);
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.fc-scroller::-webkit-scrollbar-thumb:hover {
    background: var(--fc-gray-400);
}

/* POPOVER */
.fc-popover {
    background: var(--fc-white);
    border: 1px solid var(--fc-gray-200);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
}

.fc-popover-header {
    background: var(--fc-gray-50);
    border-bottom: 1px solid var(--fc-gray-200);
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.fc-popover-body {
    padding: 0.5rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .fc-header-toolbar {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem !important;
    }
    
    .fc-toolbar-title {
        font-size: 1.25rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .fc-button {
        padding: 0.375rem 0.5rem !important;
        font-size: 0.75rem !important;
        margin: 0 0.0625rem !important;
    }
    
    .fc-col-header-cell-cushion {
        font-size: 0.75rem !important;
    }
    
    .fc-daygrid-day-number {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.75rem !important;
    }
    
    .fc-daygrid-day {
        min-height: 80px;
    }
    
    .taxes-calendar-container {
        padding: 0.5rem;
    }
    
    .fc-event-title {
        font-size: 0.625rem !important;
    }
}

@media (max-width: 480px) {
    .fc-toolbar-title {
        font-size: 1rem !important;
    }
    
    .fc-button {
        padding: 0.25rem 0.375rem !important;
        font-size: 0.625rem !important;
    }
    
    .fc-daygrid-day {
        min-height: 60px;
    }
    
    .fc-daygrid-day-number {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.625rem !important;
    }
}

/* ESTADOS DE CARGA */
.fc-loading {
    position: relative;
}

.fc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--fc-gray-200);
    border-top: 3px solid var(--fc-primary);
    border-radius: 50%;
    animation: fc-spin 1s linear infinite;
    z-index: 1000;
}

@keyframes fc-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* MODAL MODERNO PARA EVENTOS */
.taxes-modal-modern .modal-content {
    border: none;
    border-radius: var(--fc-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.taxes-modal-modern .modal-header {
    background: linear-gradient(135deg, var(--fc-primary) 0%, var(--fc-primary-dark) 100%);
    color: var(--fc-white);
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
}

.taxes-modal-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
    display: flex;
    align-items: center;
}

.taxes-modal-modern .modal-body {
    padding: 1.5rem;
    background: var(--fc-gray-50);
}

.taxes-modal-modern .modal-footer {
    background: var(--fc-white);
    border-top: 1px solid var(--fc-gray-200);
    padding: 1rem 1.5rem;
}

/* INPUTS MODERNOS PARA EL MODAL */
.taxes-input-modern {
    border: 2px solid var(--fc-gray-200);
    border-radius: 0.375rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    background: var(--fc-white);
}

.taxes-input-modern:focus {
    border-color: var(--fc-primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.taxes-color-picker {
    width: 60px;
    height: 40px;
    padding: 0.25rem;
    border: 2px solid var(--fc-gray-200);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--fc-white);
}

.taxes-color-picker:hover {
    border-color: var(--fc-primary-light);
    transform: scale(1.05);
}

.taxes-switch-modern {
    font-weight: 600;
}

/* ANIMACIONES DE ENTRADA */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.taxes-calendar-wrapper {
    animation: fadeInUp 0.5s ease-out;
}

/* MEJORAS PARA ACCESIBILIDAD */
.fc-button:focus-visible {
    outline: 2px solid var(--fc-white);
    outline-offset: 2px;
}

.fc-event:focus-visible {
    outline: 2px solid var(--fc-primary);
    outline-offset: 2px;
}

.fc-daygrid-day-number:focus-visible {
    outline: 2px solid var(--fc-primary);
    outline-offset: 2px;
}

/* HOVER EFFECTS MEJORADOS */
.fc-event {
    position: relative;
    overflow: hidden;
}

.fc-event::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.fc-event:hover::before {
    left: 100%;
}