/**
 * Control Horario - Estilos Personalizados
 */

:root {
    --color-primary: #0d9488;
    --color-primary-dark: #0f766e;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f9fafb;
    -webkit-tap-highlight-color: transparent;
}

/* Botones */
button {
    cursor: pointer;
    font-size: 1rem;
    border: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

button:active {
    transform: scale(0.98);
}

/* Inputs */
input,
select,
textarea {
    font-size: 16px; /* Prevenir zoom en iOS */
    font-family: inherit;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animaciones */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ═══════════════════════════════════════════ */
/* SaaS Premium Card                          */
/* ═══════════════════════════════════════════ */
.saas-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.saas-card:hover {
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.06),
        0 12px 28px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════ */
/* Ping slow animation for status indicator   */
/* ═══════════════════════════════════════════ */
@keyframes ping-slow {
    0% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0.2;
    }
}

.animate-ping-slow {
    animation: ping-slow 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background-color: #fee2e2;
    color: #7f1d1d;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background-color: #fef3c7;
    color: #78350f;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e3a8a;
    border-left: 4px solid #3b82f6;
}

/* Form */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive grid */
@media (max-width: 640px) {
    .grid-auto-fit {
        grid-template-columns: 1fr;
    }
}

/* Utility classes */
.text-muted {
    color: #6b7280;
}

.text-small {
    font-size: 0.875rem;
}

.text-smaller {
    font-size: 0.75rem;
}

.shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Tabla */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background-color: #f3f4f6;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

table tr:hover {
    background-color: #f9fafb;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none;
    }
}

@media (min-width: 769px) {
    .hidden-desktop {
        display: none;
    }
}

/* Estilo para reloj digital */
.digital-clock {
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 0.05em;
}

/* Indicador de estado */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: currentColor;
}

.status-working {
    color: #10b981;
}

.status-paused {
    color: #f59e0b;
}

.status-offline {
    color: #6b7280;
}

/* Safe area para notch */
@supports (padding: max(0px)) {
    body {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}
