/**
 * Custom Page-Specific Styles
 * These styles are for specific components and pages
 * General theme is handled by shivam-theme.css
 */

/* -------------------------------------------------- */
/* Jewelry row drag handle                            */
/* -------------------------------------------------- */
.jewelry-row {
    cursor: move;
}

/* -------------------------------------------------- */
/* Fancy table style for bin product listing          */
/* Uses light theme for better product visibility     */
/* -------------------------------------------------- */
.fancy-table {
    background-color: #ffffff !important;
    color: #000000 !important;
}

.fancy-table th,
.fancy-table td {
    vertical-align: middle;
    padding: 0.5rem;
    border-top: 1px solid #dee2e6;
    color: #000000 !important;
    background-color: #ffffff !important;
}

.fancy-table thead th {
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.fancy-table tbody tr:nth-of-type(odd) {
    background-color: #f9f9f9 !important;
}

.fancy-table tbody tr:nth-of-type(odd) td {
    background-color: #f9f9f9 !important;
}

.fancy-table tbody tr:hover td {
    background-color: #e9ecef !important;
}

.fancy-table img.table-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.fancy-table td.image-column {
    width: 60px;
}

.fancy-table a {
    color: #334b80 !important;
    text-decoration: none;
}

.fancy-table a:hover {
    color: #243350 !important;
    text-decoration: underline;
}

/* -------------------------------------------------- */
/* Jewelry listing form - suggestion dropdowns        */
/* -------------------------------------------------- */
#jewelry-suggestions .list-group-item,
#jewelry-suggestions .list-group-item:hover,
#jewelry-suggestions .list-group-item:focus {
    color: #000 !important;
    background-color: #fff !important;
}

table#selected-jewelry tbody tr {
    background-color: #f7f7f7 !important;
}

table#selected-jewelry input.price-input {
    width: 80px;
}

/* -------------------------------------------------- */
/* SKU suggestion dropdown styling                    */
/* -------------------------------------------------- */
.sku-suggestions {
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--bg-card, #1e1e1e);
    border: 1px solid var(--border-color, #333);
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.sku-suggestions .list-group-item {
    color: var(--text-primary, #f5f5f5) !important;
    background-color: var(--bg-card, #1e1e1e) !important;
    border-color: var(--border-color, #333) !important;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.sku-suggestions .list-group-item:hover,
.sku-suggestions .list-group-item:focus {
    color: var(--text-primary, #f5f5f5) !important;
    background-color: var(--bg-hover, #2a2a2a) !important;
}

/* -------------------------------------------------- */
/* Memo/Invoice summary box                           */
/* -------------------------------------------------- */
.memo-summary-box {
    color: var(--text-primary, #f5f5f5) !important;
    background-color: var(--bg-card, #1e1e1e);
    border: 1px solid var(--border-color, #333);
    border-radius: 4px;
    padding: 1rem;
    width: 280px;
    margin-left: auto;
}

.memo-summary-box strong {
    color: var(--text-primary, #f5f5f5);
}

/* Memo links in main content */
.container-fluid a.memo-link {
    color: var(--accent-hover, #4a6ba8) !important;
}

.container-fluid a.memo-link:hover {
    color: var(--text-primary, #f5f5f5) !important;
}

/* -------------------------------------------------- */
/* Customer view page styling                         */
/* -------------------------------------------------- */

/* Tabs */
.customer-tabs .nav-link {
    background-color: var(--bg-card, #1e1e1e);
    color: var(--text-secondary, #b8b8b8);
    border: 1px solid var(--border-color, #333);
    margin-right: 0.25rem;
    border-radius: 4px 4px 0 0;
}

.customer-tabs .nav-link:hover {
    background-color: var(--bg-hover, #2a2a2a);
    color: var(--text-primary, #f5f5f5);
}

.customer-tabs .nav-link.active {
    background-color: var(--accent-primary, #334b80);
    color: var(--text-primary, #f5f5f5);
    border-color: var(--accent-primary, #334b80);
}

/* Dark table for customer summary */
.customer-table {
    background-color: var(--bg-secondary, #1a1a1a) !important;
    color: var(--text-primary, #f5f5f5) !important;
}

.customer-table th,
.customer-table td {
    background-color: var(--bg-secondary, #1a1a1a) !important;
    color: var(--text-primary, #f5f5f5) !important;
    border-color: var(--border-color, #333) !important;
}

.customer-table tbody tr:hover td {
    background-color: var(--bg-hover, #2a2a2a) !important;
}

/* Collection and style rows */
.customer-table .collection-row td {
    background-color: var(--accent-secondary, #243350) !important;
    font-weight: bold;
}

.customer-table .style-row td {
    background-color: var(--bg-card, #1e1e1e) !important;
    font-style: italic;
    padding-left: 1rem;
}

/* Customer table memo links */
.customer-table a.memo-link {
    color: var(--accent-hover, #4a6ba8) !important;
}

.customer-table a.memo-link:hover {
    color: var(--text-primary, #f5f5f5) !important;
}

/* -------------------------------------------------- */
/* Media preview/upload styling                       */
/* -------------------------------------------------- */
.media-item {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 0.5rem;
    border: 1px solid var(--border-color, #333);
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--bg-secondary, #1a1a1a);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background-color: rgba(184, 74, 74, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-item .remove-btn:hover {
    background-color: #b84a4a;
}

.media-display-item {
    width: 140px;
    height: 140px;
    margin: 0.5rem;
    border: 1px solid var(--border-color, #333);
    border-radius: 4px;
    overflow: hidden;
}

.media-display-item img,
.media-display-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* -------------------------------------------------- */
/* Print tag styling                                  */
/* -------------------------------------------------- */
@media print {
    .print-tag {
        page-break-inside: avoid;
    }
}

/* -------------------------------------------------- */
/* Form inline adjustments for sidebar SKU lookup     */
/* -------------------------------------------------- */
.sidebar .form-inline .form-control {
    min-height: 32px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.sidebar .form-inline .btn {
    min-height: 32px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* -------------------------------------------------- */
/* Mobile improvements for tables                     */
/* -------------------------------------------------- */
@media (max-width: 767.98px) {
    /* Make tables horizontally scrollable */
    .table-responsive-mobile {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Smaller padding on mobile */
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    /* Smaller images on mobile */
    .fancy-table img.table-img {
        width: 40px;
        height: 40px;
    }

    .fancy-table td.image-column {
        width: 40px;
    }

    .media-item {
        width: 80px;
        height: 80px;
    }

    .media-display-item {
        width: 100px;
        height: 100px;
    }

    /* Summary box full width on mobile */
    .memo-summary-box {
        width: 100%;
        margin-left: 0;
        margin-top: 1rem;
    }
}
