/* frontend/assets/css/components.css */

/* --- CARDS --- */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* --- BUTTONS (Fixed Height 40px) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
}

.btn-sm {
    height: 32px;
    font-size: 12px;
    padding: 0 12px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

/* 🔥 FIX: Removed variable dependency that was making button white */
.btn-primary:hover {
    opacity: 0.9; /* Simple hover effect */
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger-outline {
    background: white;
    border: 1px solid #fee2e2;
    color: var(--danger-color);
}

.btn-danger-outline:hover {
    background: #fef2f2;
    border-color: var(--danger-color);
}

/* --- TABLES --- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    text-align: left;
    padding: 14px 20px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-main);
    vertical-align: middle;
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.modal-overlay.show {
    display: flex !important;
}

.modal-content,
.modal-box {
    background: #ffffff;
    width: 90%;
    max-width: 450px;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    position: relative;
}

/* --- FORMS --- */
.form-control,
.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* =========================================
   GLOBAL SKELETON LOADER (For All Pages)
   ========================================= */

.skeleton {
    background: #e2e8f0; /* Light Grey Base */
    color: transparent !important; /* Text chupane ke liye */
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    cursor: wait;
}

/* Shimmer Animation Effect */
.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Chamak (Shine) Effect */
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        transparent 100%
    );
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

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

/* --- Common Skeleton Sizes (Helpers) --- */
.sk-text {
    height: 14px;
    margin-bottom: 6px;
    width: 100%;
}

.sk-heading {
    height: 24px;
    width: 60%;
    margin-bottom: 10px;
}

.sk-badge {
    height: 24px;
    width: 70px;
    border-radius: 20px;
}

.sk-btn {
    height: 36px;
    width: 100%;
    border-radius: 8px;
}

/* Specific for Dashboard Cards */
.sk-card-icon {
    width: 40px; 
    height: 40px; 
    border-radius: 50%;
}