/* =====================================================
   COMPONENTS.CSS
   Reusable UI Components (Cards, Buttons, Badges, etc.)
===================================================== */

/* ================= CARD VARIANTS ================= */
.card {
    position: relative;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 12px;
    opacity: 0.7;
}

.card-footer {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ================= BUTTON VARIANTS ================= */
.btn-primary {
    background: #3b82f6;
}

.btn-success {
    background: #16a34a;
}

.btn-warning {
    background: #facc15;
    color: black;
}

.btn-danger {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 16px;
}

/* ================= BADGES ================= */
.badge {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.badge-info {
    background: #3b82f6;
}

.badge-success {
    background: #16a34a;
}

.badge-warning {
    background: #facc15;
    color: black;
}

.badge-danger {
    background: #dc2626;
}

/* ================= TAGS ================= */
.tag {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    margin: 3px;
    font-size: 12px;
}

/* ================= ALERT BOX ================= */
.alert {
    padding: 12px;
    border-radius: 10px;
    margin-top: 10px;
    font-size: 14px;
}

.alert-info {
    background: rgba(59,130,246,0.2);
}

.alert-success {
    background: rgba(22,163,74,0.2);
}

.alert-warning {
    background: rgba(250,204,21,0.2);
    color: black;
}

.alert-danger {
    background: rgba(220,38,38,0.2);
}

/* ================= ICON BUTTON ================= */
.icon-btn {
    position: relative;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    border-radius: 8px;
    transition: 0.3s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* ================= USER PROFILE ================= */
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* ================= SEARCH BOX ================= */
.search-box {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    width: 100%;
}

/* ================= LIST GROUP ================= */
.list-group {
    margin-top: 10px;
}

.list-item {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 5px;
    background: rgba(255,255,255,0.05);
    transition: 0.3s;
}

.list-item:hover {
    background: rgba(255,255,255,0.1);
}

/* ================= TABLE ================= */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.table th, .table td {
    padding: 10px;
    text-align: left;
}

.table th {
    background: rgba(255,255,255,0.1);
}

.table tr:hover {
    background: rgba(255,255,255,0.05);
}

/* ================= MODAL ================= */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #020617;
    padding: 20px;
    border-radius: 12px;
    width: 400px;
    z-index: 200;
    display: none;
}

.modal.active {
    display: block;
    transform: translate(-50%, -50%) scale(1);
}

/* ================= TOOLTIP ================= */
.tooltip {
    position: relative;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    background: #1e293b;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
}

/* ================= DIVIDER ================= */
.divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 0;
}

/* ================= SWITCH TOGGLE ================= */
.switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    background: #ccc;
    border-radius: 20px;
    width: 100%;
    height: 100%;
}

.slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.switch input:checked + .slider {
    background: #3b82f6;
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

/* ================= ACCORDION ================= */
.accordion {
    border-radius: 10px;
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.accordion-header {
    padding: 10px;
    cursor: pointer;
}

.accordion-content {
    display: none;
    padding: 10px;
}

.accordion-item.active .accordion-content {
    display: block;
}

/* ================= TOAST ================= */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: 8px;
    background: #3b82f6;
    animation: fadeIn 0.5s ease;
}

/* ================= LOADING SKELETON ================= */
.skeleton {
    background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}