/* ============================================
   FICHADOR MODERNO - INFINITY GESTIÓN v1.0.1
   ============================================ */

/* Variables CSS */
:root {
    --ig-primary: #667eea;
    --ig-primary-dark: #5568d3;
    --ig-secondary: #764ba2;
    --ig-success: #10b981;
    --ig-warning: #f59e0b;
    --ig-danger: #ef4444;
    --ig-info: #3b82f6;
    --ig-gray-50: #f9fafb;
    --ig-gray-100: #f3f4f6;
    --ig-gray-200: #e5e7eb;
    --ig-gray-300: #d1d5db;
    --ig-gray-400: #9ca3af;
    --ig-gray-500: #6b7280;
    --ig-gray-600: #4b5563;
    --ig-gray-700: #374151;
    --ig-gray-800: #1f2937;
    --ig-gray-900: #111827;
}

/* Contenedor principal */
.ig-fichador-wrapper {
    max-width: 600px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--ig-gray-50) 0%, #ffffff 100%);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08), 
                0 10px 25px rgba(0, 0, 0, 0.04);
}

/* Header con información del usuario */
.ig-fichador-header {
    background: linear-gradient(135deg, var(--ig-primary) 0%, var(--ig-secondary) 100%);
    padding: 30px;
    color: white;
}

.ig-fichador-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ig-user-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ig-user-details h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.ig-user-role {
    margin: 4px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

/* Sección del reloj */
.ig-fichador-clock-section {
    padding: 40px 30px;
    background: white;
    text-align: center;
}

.ig-clock-container {
    position: relative;
}

.ig-fichador-clock {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
    font-size: 72px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ig-primary) 0%, var(--ig-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1;
    letter-spacing: -2px;
    text-shadow: 0 2px 20px rgba(102, 126, 234, 0.2);
}

.ig-fichador-date {
    font-size: 16px;
    color: var(--ig-gray-500);
    margin: 12px 0 0 0;
    font-weight: 500;
}

/* Botones de acción */
.ig-fichador-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 30px 30px;
    background: white;
}

.ig-fichador-button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ig-fichador-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.ig-fichador-button:hover::before {
    opacity: 1;
}

.ig-fichador-button:active {
    transform: scale(0.98);
}

.ig-btn-primary {
    background: linear-gradient(135deg, var(--ig-success) 0%, #059669 100%);
    color: white;
}

.ig-btn-primary:hover {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.ig-btn-secondary {
    background: linear-gradient(135deg, var(--ig-warning) 0%, #d97706 100%);
    color: white;
}

.ig-btn-secondary:hover {
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
}

.ig-fichador-button:disabled {
    background: var(--ig-gray-200) !important;
    color: var(--ig-gray-400) !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.ig-fichador-button:disabled::before {
    display: none;
}

.ig-btn-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-btn-icon .dashicons {
    width: 32px;
    height: 32px;
    font-size: 32px;
}

.ig-btn-text {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Secciones de resumen */
.ig-fichador-summary {
    margin: 0;
    padding: 24px 30px;
    background: white;
    border-top: 1px solid var(--ig-gray-100);
}

.ig-fichador-summary:last-child {
    border-radius: 0 0 24px 24px;
}

.ig-summary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ig-gray-100);
}

.ig-summary-header .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
    color: var(--ig-primary);
}

.ig-summary-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ig-gray-800);
    flex-grow: 1;
}

.ig-week-range {
    font-size: 13px;
    color: var(--ig-gray-500);
    font-weight: 500;
    background: var(--ig-gray-100);
    padding: 4px 12px;
    border-radius: 12px;
}

/* Resumen semanal */
.ig-weekly-summary .ig-summary-content {
    text-align: center;
}

.ig-hours-display {
    margin-bottom: 20px;
}

.ig-hours-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ig-primary) 0%, var(--ig-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.ig-hours-label {
    display: block;
    font-size: 14px;
    color: var(--ig-gray-500);
    font-weight: 500;
}

.ig-progress-bar {
    height: 12px;
    background: var(--ig-gray-100);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.ig-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ig-success) 0%, #059669 100%);
    border-radius: 12px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ig-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.ig-progress-text {
    font-size: 13px;
    color: var(--ig-gray-600);
    font-weight: 600;
}

/* Resumen diario */
.ig-daily-summary .ig-summary-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ig-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--ig-gray-50);
    border-radius: 12px;
    border: 1px solid var(--ig-gray-100);
    transition: all 0.2s;
}

.ig-summary-item:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ig-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.ig-item-entrada .ig-item-icon {
    background: linear-gradient(135deg, var(--ig-success) 0%, #059669 100%);
    color: white;
}

.ig-item-descanso .ig-item-icon {
    background: linear-gradient(135deg, var(--ig-warning) 0%, #d97706 100%);
    color: white;
}

.ig-item-salida .ig-item-icon {
    background: linear-gradient(135deg, var(--ig-danger) 0%, #dc2626 100%);
    color: white;
}

.ig-item-icon .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.ig-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ig-item-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ig-gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ig-item-time {
    font-size: 13px;
    color: var(--ig-gray-500);
    font-weight: 500;
}

.ig-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ig-badge-active {
    background: var(--ig-warning);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ig-item-active {
    border-color: var(--ig-warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(217, 119, 6, 0.05) 100%);
}

/* Totales del día */
.ig-summary-total {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 2px solid var(--ig-gray-100);
    display: flex;
    justify-content: space-around;
    gap: 16px;
}

.ig-total-item {
    text-align: center;
    flex: 1;
}

.ig-total-label {
    display: block;
    font-size: 12px;
    color: var(--ig-gray-500);
    margin-bottom: 6px;
    font-weight: 500;
}

.ig-total-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--ig-primary);
}

/* Estado vacío */
.ig-summary-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--ig-gray-400);
}

.ig-summary-empty .dashicons {
    width: 48px;
    height: 48px;
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.ig-summary-empty p {
    margin: 0;
    font-size: 14px;
    color: var(--ig-gray-500);
}

/* Modal de motivos */
.ig-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.ig-modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ig-modal-content {
    background: white;
    padding: 32px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ig-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.ig-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--ig-gray-800);
}

.ig-modal-close {
    background: var(--ig-gray-100);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ig-modal-close:hover {
    background: var(--ig-gray-200);
    transform: rotate(90deg);
}

.ig-modal-close .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: var(--ig-gray-600);
}

.ig-motivos-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ig-motivo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ig-gray-50);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: var(--ig-gray-700);
}

.ig-motivo-item:hover {
    background: white;
    border-color: var(--ig-primary);
    color: var(--ig-primary);
    transform: translateX(4px);
}

.ig-motivo-item .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.ig-modal-hint {
    margin: 16px 0 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--ig-gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ig-modal-hint .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 640px) {
    .ig-fichador-wrapper {
        margin: 20px auto;
        border-radius: 16px;
    }

    .ig-fichador-clock {
        font-size: 56px;
    }

    .ig-hours-number {
        font-size: 40px;
    }

    .ig-fichador-actions {
        grid-template-columns: 1fr;
    }

    .ig-summary-total {
        flex-direction: column;
        gap: 12px;
    }

    .ig-modal-content {
        padding: 24px;
    }
}

/* Animación de carga */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ig-fichador-wrapper > * {
    animation: fadeInUp 0.4s ease-out backwards;
}

.ig-fichador-wrapper > *:nth-child(1) { animation-delay: 0.05s; }
.ig-fichador-wrapper > *:nth-child(2) { animation-delay: 0.1s; }
.ig-fichador-wrapper > *:nth-child(3) { animation-delay: 0.15s; }
.ig-fichador-wrapper > *:nth-child(4) { animation-delay: 0.2s; }
.ig-fichador-wrapper > *:nth-child(5) { animation-delay: 0.25s; }
