@tailwind base;
@tailwind components;
@tailwind utilities;
@import 'datatable.css';
[x-cloak] { display: none !important; }

@layer components {
    /* Cards */
    .card {
        @apply bg-white dark:bg-slate-800 rounded-2xl border border-slate-200 dark:border-slate-700 shadow-sm;
    }
    
    /* Buttons */
    .btn {
        @apply inline-flex items-center justify-center gap-2 px-4 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2;
    }
    .btn-primary {
        @apply btn bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500 shadow-lg shadow-blue-500/25;
    }
    .btn-secondary {
        @apply btn bg-slate-100 text-slate-700 hover:bg-slate-200 dark:bg-slate-700 dark:text-slate-300 dark:hover:bg-slate-600;
    }
    
    /* Form Inputs */
    .input {
        @apply w-full px-4 py-2.5 bg-white dark:bg-slate-800 border border-slate-300 dark:border-slate-600 rounded-xl text-slate-900 dark:text-white placeholder-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 transition-all;
    }
    
    /* Table */
    .table-wrapper {
        @apply overflow-x-auto;
    }
    .table {
        @apply w-full text-sm text-left;
    }
    .table th {
        @apply px-6 py-3 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-400 bg-slate-50 dark:bg-slate-800/50;
    }
    .table td {
        @apply px-6 py-4 text-slate-700 dark:text-slate-300 border-t border-slate-200 dark:border-slate-700;
    }
}

/* ==========================================
   GLOBAL DT-WRAPPER & DT-TABLE STYLES
   For ALL modules (Todo, etc)
   ========================================== */

.dt-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.dt-controls-bar {
    padding: 20px 24px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.dt-search-box {
    flex: 1;
    min-width: 250px;
}

.dt-search-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

.dt-search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: white;
}

.dt-search-box input::placeholder {
    color: #999;
}

.dt-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.dt-filters select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

.dt-filters select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-reset {
    padding: 10px 16px;
    background: #e2e8f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-reset:hover {
    background: #cbd5e1;
}

.dt-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.dt-table thead tr {
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
}

.dt-table thead th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.dt-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.3s;
}

.dt-table tbody tr:hover {
    background: #f8fafc;
}

.dt-table tbody td {
    padding: 14px 12px;
    color: #4a5568;
    font-size: 14px;
    font-family: inherit;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-in-progress {
    background: #dbeafe;
    color: #0c2d6b;
}

.status-cancelled {
    background: #fee2e2;
    color: #7f1d1d;
}

.priority-low {
    background: #d1fae5;
    color: #065f46;
}

.priority-medium {
    background: #fef08a;
    color: #713f12;
}

.priority-high {
    background: #fed7aa;
    color: #92400e;
}

.priority-critical {
    background: #fecaca;
    color: #7f1d1d;
}

.btn-action {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    margin-right: 6px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-family: inherit;
    border: 1px solid transparent;
}

.btn-edit {
    background: #dbeafe;
    color: #0c2d6b;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.btn-delete {
    background: #fee2e2;
    color: #7f1d1d;
}

.btn-delete:hover {
    background: #fecaca;
}

.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    font-family: inherit;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.btn-page {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-page:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

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

.btn-new {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 11px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.btn-export {
    background: #e2e8f0;
    color: #334155;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-export:hover {
    background: #cbd5e1;
}