﻿/* =========================== 
   🔹 List Page (Reusable) 
   Used for: Suppliers, Customers, Products, etc.
   Old class: .suppliers-page
   New reusable class: .list-page
   =========================== */

/* ====== Card Container ====== */
.list-page .card,
.suppliers-page .card {
    font-family: Arial, sans-serif;
    margin: 40px auto;
    border-radius: 20px;
    background: var(--color-bg-content, #fff);
    width: 95%;
    max-width: 1200px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* ====== Title ====== */
.bp-header h2,
.list-page h2,
.suppliers-page h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(90deg, var(--color-accent, #635BFF), #00D4FF, var(--color-accent, #635BFF));
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: moveGradient 10s linear infinite;
}

/* ====== Table ====== */
.list-page table,
.suppliers-page table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 15px;
    overflow: hidden;
    table-layout: fixed;
    background: var(--color-bg-container, #f8f8f8);
}

.list-page thead,
.suppliers-page thead {
    background: linear-gradient(90deg, var(--color-accent, #635BFF), #8E7CFF, #00D4FF);
    color: #fff;
}

    .list-page thead th,
    .suppliers-page thead th {
        padding: 10px 5px;
        text-align: center;
        font-size: 15px;
        font-weight: 600;
    }

/* ====== Table Body ====== */
.list-page tbody tr,
.suppliers-page tbody tr {
    border-bottom: 1px solid var(--color-hover-accent, #eee);
    transition: all 0.3s ease;
}

    .list-page tbody tr:hover,
    .suppliers-page tbody tr:hover {
        background: var(--color-hover-accent, #f0f0ff);
        transform: scale(1.01);
    }

.list-page tbody td,
.suppliers-page tbody td {
    padding: 8px;
    font-size: 14px;
    color: var(--color-text-main, #333);
    text-align: center;
}

/* ====== Action Buttons ====== */
.list-page .btn,
.suppliers-page .btn {
    border: none;
    outline: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 1px;
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.list-page .btn-update,
.suppliers-page .btn-update {
    background: #F8C20A;
    color: #fff;
}

    .list-page .btn-update:hover,
    .suppliers-page .btn-update:hover {
        background: #f8c10a64;
        transform: scale(1.05);
        color: #fff;
    }

.list-page .btn-view,
.suppliers-page .btn-view {
    background: #16CDC7;
    color: #fff;
}

    .list-page .btn-view:hover,
    .suppliers-page .btn-view:hover {
        background: #16cdc760;
        transform: scale(1.05);
        color: #fff;
    }

.list-page .btn-delete,
.suppliers-page .btn-delete {
    background: #FF6692;
    color: #fff;
}

    .list-page .btn-delete:hover,
    .suppliers-page .btn-delete:hover {
        background: #ff669165;
        transform: scale(1.05);
        color: #fff;
    }

.list-page tbody td:last-child,
.suppliers-page tbody td:last-child {
    border-bottom: none;
    display: flex;
    justify-content: center; 
    gap: 10px;
    text-align: center;
    align-items: center;
}
    .list-page tbody td:last-child .action-buttons,
    .suppliers-page tbody td:last-child .action-buttons {
        display: flex;
        gap: 10px;
    }



/* Make DELETE button same size as action <a> buttons */
.action-buttons form button.btn-delete {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ====== Active / Inactive Status ====== */
.list-page .status,
.suppliers-page .status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
    transition: all 0.3s ease;
}

    .list-page .status.active,
    .suppliers-page .status.active {
        color: #0f9d58;
        background-color: rgba(15, 157, 88, 0.15);
        border: 1px solid rgba(15, 157, 88, 0.3);
    }

    .list-page .status.inactive,
    .suppliers-page .status.inactive {
        color: #d93025;
        background-color: rgba(217, 48, 37, 0.15);
        border: 1px solid rgba(217, 48, 37, 0.3);
    }

/* ====== Floating Add Button ====== */
.list-page .floating-btn,
.suppliers-page .floating-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    background: linear-gradient(90deg, var(--color-accent, #635BFF), #8E7CFF);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 999;
}

    .list-page .floating-btn:hover,
    .suppliers-page .floating-btn:hover {
        background: linear-gradient(90deg, #4d46d3, #6b5de6);
        transform: scale(1.1);
        color: #fff;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    }

    .list-page .floating-btn i,
    .suppliers-page .floating-btn i {
        margin: 0;
        line-height: 1;
        font-size: 24px;
    }

/* ====== Responsive: Table to Card ====== */
@media (max-width: 800px) {
    .list-page table,
    .list-page thead,
    .list-page tbody,
    .list-page th,
    .list-page td,
    .list-page tr,
    .suppliers-page table,
    .suppliers-page thead,
    .suppliers-page tbody,
    .suppliers-page th,
    .suppliers-page td,
    .suppliers-page tr {
        display: block;
        width: 100%;
        table-layout: auto;
    }

    .list-page thead,
    .suppliers-page thead {
        display: none;
    }

    .list-page tbody tr,
    .suppliers-page tbody tr {
        background: var(--color-bg-content, #fff);
        margin-bottom: 20px;
        border-radius: 15px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.08);
        padding: 15px;
        transition: all 0.3s ease;
    }

        .list-page tbody tr:hover,
        .suppliers-page tbody tr:hover {
            transform: translateY(-3px);
        }

    .list-page tbody td,
    .suppliers-page tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--color-hover-accent, #eee);
        text-align: left;
    }

        .list-page tbody td::before,
        .suppliers-page tbody td::before {
            content: attr(data-label);
            font-weight: 600;
            color: var(--color-accent, #635BFF);
            margin-right: 10px;
        }

        .list-page tbody td:last-child,
        .suppliers-page tbody td:last-child {
            border-bottom: none;
            display: flex;
            gap: 10px;
            text-align: left;
            justify-content: space-between;
            align-items: center;
        }

    .list-page .btn,
    .suppliers-page .btn {
        width: 25px;
        height: 25px;
        font-size: 13px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

        .list-page .btn i,
        .suppliers-page .btn i {
            font-size: 15px;
        }

        .list-page .btn:hover,
        .suppliers-page .btn:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        }
}



.preview-grid-create {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    width: 100%;
}

.preview-item-create {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-bg-container);
    border-radius: 6px;
    padding: 10px 12px;
    border: 1px solid #eee;
    font-size: 13px;
    transition: all 0.3s ease;
}

    .preview-item-create:hover {
        transform: scale(1.02);
        box-shadow: 0 1px 6px var(--color-hover-accent);
    }




/* Container Box */
.currency-breakdown-box {
    background: var(--color-bg-body);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Title */
.currency-breakdown-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-accent);
    text-align: center;
    margin: 0;
}

/* Items Grid */
.currency-breakdown-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

/* Individual Currency Card */
.currency-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-container);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
    text-align: center;
}

    .currency-item:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    }

/* Label */
.currency-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-accent);
    margin-bottom: 6px;
}

/* Value */
.currency-value {
    font-size: 16px;
    font-weight: 700;
    color: #28a745;
    margin-bottom: 4px;
}

/* Subtext */
.currency-subtext {
    font-size: 12px;
    color: var(--color-text-muted);
}


.dark .currency-item {
    background: var(--color-bg-container);
    border: 1px solid #444;
}

    .currency-item:hover {
        box-shadow: 0 4px 10px rgba(142,124,255,0.25);
    }

.list-page td.text-end {
    white-space: nowrap;
}
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    white-space: nowrap; /* 🚨 يمنع نزول الأعمدة تحت بعض */
}

    .table-responsive table {
        width: 100%;
        min-width: 1400px; /* ✨ اجعلي الجدول كبير بما يكفي ليحتاج سكرول */
    }

.list-page thead th {
    white-space: nowrap; /* يمنع النص من النزول لسطور */
}



/* === GRID === */
.bp-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* === CARD BASE === */
.bp-card {
    background: var(--color-bg-content);
    border-radius: 14px;
    box-shadow: 0 3px 8px #00000010;
    border: 1px solid #00000010;
    overflow: hidden;
    color: var(--color-text-main);
}

/* === CARD HEADER === */
.bp-card-header {
    background: var(--color-bg-container);
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid #00000015;
}

.dark .bp-card-header {
    border-bottom-color: #ffffff15;
}

/* === CARD BODY === */
.bp-card-body {
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
}

/* === INFO CARD (Accent) === */
.bp-card-info .bp-card-header {
    background: var(--color-accent);
    color: var(--color-active-accent);
}

/* === ALERTS === */
.bp-alert-warning,
.bp-alert-info {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.bp-alert-warning {
    background: #ffcf3f26;
    border: 1px solid #ffcf3f55;
    color: #836700;
}

.bp-alert-info {
    background: #3f9cff26;
    border: 1px solid #3f9cff55;
    color: #004a99;
}

.dark .bp-alert-info,
.dark .bp-alert-warning {
    border-color: #ffffff33;
}

/* === TABLE FOOTER (DARK + LIGHT SUPPORT) === */
table tfoot {
    background: var(--color-bg-container) !important;
    color: var(--color-text-main) !important;
    border-top: 2px solid var(--color-accent) !important;
}

    table tfoot td {
        font-weight: 600;
        color: var(--color-text-main) !important;
    }

/* === COLOR FIXES FOR DARK MODE INSIDE FOOTER === */
.dark table tfoot td.text-success {
    color: #4cd964 !important;
}

.dark table tfoot td.text-danger {
    color: #ff6b6b !important;
}

.dark table tfoot td.text-primary {
    color: var(--color-accent) !important;
}

/* === TABLE SCROLL SUPPORT === */
.table-responsive {
    overflow-x: auto;
    background: var(--color-bg-content);
    border-radius: 10px;
    border: 1px solid #00000015;
}

    /* === SCROLLBAR STYLING === */
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }

    .table-responsive::-webkit-scrollbar-track {
        background: var(--color-bg-container);
        border-radius: 10px;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--color-text-muted);
        border-radius: 10px;
    }

        .table-responsive::-webkit-scrollbar-thumb:hover {
            background: var(--color-accent);
        }

/* === DARK MODE SCROLLBAR FIX === */
.dark .table-responsive::-webkit-scrollbar-track {
    background: #111a2b;
}

.dark .table-responsive::-webkit-scrollbar-thumb {
    background: #5f6b7a;
}

    .dark .table-responsive::-webkit-scrollbar-thumb:hover {
        background: var(--color-accent);
    }
.card-section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text-main) !important;
}

.form-label {
    transition: color 0.2s ease, font-weight 0.2s ease;
    color: var(--color-text-main);
}

    .form-label.highlighted {
        color: var(--color-accent);
        font-weight: 600;
    }

/* Highlight label when parent div contains focus */
.bp-search-form .col-md-2:focus-within label {
    color: var(--color-accent);
    font-weight: 600;
}
.bp-search-card {
    background-color: var(--color-bg-body);
}













/* ====== Calendar Card Styling ====== */
.calendar-card {
    font-family: Arial, sans-serif;
    background: var(--color-bg-content, #fff);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    padding: 15px;
    width: 95%;
    max-width: 700px;
    margin: 0 auto 20px auto;
    box-sizing: border-box;
}

.calendar-card-header {
    background: var(--color-accent, #635BFF);
    color: #fff;
    padding: 12px 15px;
    border-radius: 15px 15px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 18px;
}

.calendar-card-body {
    padding: 15px;
}

.selected-date-box {
    margin-top: 15px;
    padding: 12px;
    background: var(--color-bg-container, #f8f8f8);
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    color: var(--color-accent, #635BFF);
    transition: all 0.3s ease;
}

    .selected-date-box:hover {
        transform: scale(1.02);
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    }

/* ====== Responsive ====== */
@media (max-width: 768px) {
    .calendar-card {
        width: 100%;
        padding: 12px;
    }

    .calendar-card-header {
        font-size: 16px;
    }
}
