/**
 * CodeTasks - Modern Stylesheet
 * Inspired by contemporary dashboard designs
 */

:root {
    /* Modern Color Palette */
    --primary: #00BCD4;           /* Cyan/Turquoise */
    --primary-dark: #00ACC1;
    --secondary: #E91E63;         /* Pink */
    --accent: #9C27B0;            /* Purple */
    --success: #00BFA5;           /* Teal/Green */
    --warning: #FFC107;           /* Amber */
    --danger: #F44336;            /* Red */
    --info: #2196F3;              /* Blue */

    /* Neutrals */
    --bg-primary: #F5F7FA;        /* Light gray background */
    --bg-secondary: #FFFFFF;      /* White */
    --bg-dark: #1E293B;           /* Dark slate */
    --text-primary: #1E293B;      /* Dark text */
    --text-secondary: #64748B;    /* Gray text */
    --text-light: #94A3B8;        /* Light gray text */
    --border: #E2E8F0;            /* Light border */

    /* Gradients */
    --gradient-pink: linear-gradient(135deg, #FF6B9D 0%, #E91E63 100%);
    --gradient-purple: linear-gradient(135deg, #B968C7 0%, #9C27B0 100%);
    --gradient-cyan: linear-gradient(135deg, #4DD0E1 0%, #00BCD4 100%);
    --gradient-teal: linear-gradient(135deg, #26A69A 0%, #00897B 100%);
    --gradient-blue: linear-gradient(135deg, #42A5F5 0%, #2196F3 100%);
    --gradient-bg: linear-gradient(135deg, #F5F7FA 0%, #E8EDF3 100%);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 36px rgba(0, 0, 0, 0.15);

    /* Borders */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: 2rem; line-height: 1.2; }
h2 { font-size: 1.75rem; line-height: 1.3; }
h3 { font-size: 1.5rem; line-height: 1.3; }
h4 { font-size: 1.25rem; line-height: 1.4; }
h5 { font-size: 1.125rem; line-height: 1.4; }
h6 { font-size: 1rem; line-height: 1.4; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Auth Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--gradient-cyan);
}

.auth-card {
    background: var(--bg-secondary);
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 450px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-card .logo h1 {
    background: var(--gradient-cyan);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.25rem;
    margin-bottom: 8px;
}

.auth-card .logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
}

.form-control:hover {
    border-color: var(--primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.form-control::placeholder {
    color: var(--text-light);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.text-muted {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    font-family: inherit;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--gradient-cyan);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--gradient-teal);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
    background: #D32F2F;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover:not(:disabled) {
    background: #FFB300;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.0625rem;
}

.btn-block {
    width: 100%;
    display: flex;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar .logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar .logo h2 {
    font-size: 1.5rem;
    margin: 0;
    background: var(--gradient-cyan);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 16px 12px;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition-fast);
    font-weight: 500;
    font-size: 0.9375rem;
}

.sidebar-menu a:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.sidebar-menu a.active {
    background: var(--gradient-cyan);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 24px;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.topbar h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-cyan);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1000;
}

.user-dropdown.active {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-fast);
    font-size: 0.9375rem;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.card-body {
    padding: 0;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.stat-icon.cyan {
    background: var(--gradient-cyan);
    color: white;
}

.stat-icon.pink {
    background: var(--gradient-pink);
    color: white;
}

.stat-icon.purple {
    background: var(--gradient-purple);
    color: white;
}

.stat-icon.teal {
    background: var(--gradient-teal);
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1;
}

.stat-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #81C784;
}

.alert-error, .alert-danger {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #E57373;
}

.alert-warning {
    background: #FFF8E1;
    color: #F57C00;
    border: 1px solid #FFD54F;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #64B5F6;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

thead {
    background: var(--bg-primary);
}

th {
    text-align: left;
    padding: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

tr:hover {
    background: var(--bg-primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-primary {
    background: rgba(0, 188, 212, 0.1);
    color: var(--primary);
}

.badge-success {
    background: rgba(0, 191, 165, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 0;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-body {
    padding: 32px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px 32px;
    border-top: 1px solid var(--border);
}

/* Favicon styling */
.favicon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .auth-card {
        padding: 32px 24px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

/* === MEJORAS DE BOTONES === */
.btn {
    min-height: 40px;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.btn-warning {
    background: #FF9800;
    color: white !important; /* Forzar blanco */
}

.btn-warning:hover:not(:disabled) {
    background: #F57C00;
    color: white !important;
}

/* Botón Pausar más visible */
.btn-pause,
button[class*="pausar"],
a[class*="pausar"] {
    background: #FFA726 !important;
    color: white !important;
    border: none !important;
}

.btn-pause:hover {
    background: #FB8C00 !important;
}

/* === FLOWBITE ICON SIZES === */
.w-14 { width: 14px; }
.h-14 { height: 14px; }
.w-16 { width: 16px; }
.h-16 { height: 16px; }
.w-18 { width: 18px; }
.h-18 { height: 18px; }
.w-20 { width: 20px; }
.h-20 { height: 20px; }
.w-24 { width: 24px; }
.h-24 { height: 24px; }

/* Icon alignment */
svg.inline-block {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.sidebar-menu svg,
.btn svg,
a svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.card-title svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.logo svg {
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}
