/* FlowerShop - Main Stylesheet */

/* ===== Dynamic Design Colors with Gradients ===== */
/*
 * IMPORTANT: The following elements have DYNAMIC background gradients
 * that are set in /app/views/partials/public_layout_start.php based on
 * admin-configurable design settings from the database:
 *
 * - .navbar:not(.admin-top-navbar)       -> nav_background gradient
 * - .hero-section                        -> hero_background gradient
 * - footer.bg-dark                       -> footer_background gradient
 * - .hot-deals-section, .badge-hot       -> hot_deals_background gradient
 * - .new-arrivals-section, .badge-new    -> new_arrivals_background gradient
 *
 * Each gradient uses linear-gradient(135deg, baseColor 0%, lighterColor 100%)
 * The lighter color is automatically calculated at 15% lighter than base color.
 *
 * To modify these colors, use: Admin -> Settings -> Design
 */

/* ===== Public Navigation Bar ===== */
.navbar:not(.admin-top-navbar) {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar:not(.admin-top-navbar) .navbar-brand,
.navbar:not(.admin-top-navbar) .nav-link {
    color: #2c3e50 !important;
}

.navbar:not(.admin-top-navbar) .nav-link:hover {
    color: #1e3c72 !important;
}

.navbar:not(.admin-top-navbar) .nav-link.active {
    color: #2a5298 !important;
    font-weight: 600;
}

.navbar:not(.admin-top-navbar) .dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navbar:not(.admin-top-navbar) .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.1);
}

.navbar:not(.admin-top-navbar) .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===== Admin Top Navigation Bar ===== */
.admin-top-navbar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
}

.admin-top-navbar .navbar-brand,
.admin-top-navbar .nav-link,
.admin-top-navbar .btn-link {
    color: white !important;
}

/* ===== Auth Pages (Login, Registration, Password Reset) ===== */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.auth-card {
    max-width: 450px;
    margin: 2rem auto;
}

.auth-page .card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.auth-page .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 2rem;
    text-align: center;
}

.auth-page .card-header h2 {
    margin: 0;
    font-weight: 600;
}

.auth-page .card-body {
    padding: 2rem;
}

.auth-page .form-label {
    font-weight: 500;
    color: #495057;
}

.auth-page .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.auth-page .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 500;
    border-radius: 8px;
    transition: transform 0.2s;
}

.auth-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.auth-page .alert {
    border-radius: 8px;
    border: none;
}

.auth-page .password-toggle {
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 38px;
    color: #6c757d;
}

.auth-page .password-wrapper {
    position: relative;
}

.auth-page .links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-page .links a {
    color: #667eea;
    text-decoration: none;
    display: block;
    margin: 0.5rem 0;
}

.auth-page .links a:hover {
    text-decoration: underline;
}

/* ===== Main Content Area ===== */
.main-content {
    padding: 2rem;
}

/* Public pages - adjust padding for no sidebar */
.public-page .main-content {
    padding: 2rem 0;
}

/* ===== Admin Dashboard ===== */
.admin-sidebar {
    min-height: 100vh;
    background: #2c3e50;
    color: white;
    padding: 1.5rem 0;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #667eea;
    color: white;
}

.admin-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    margin-bottom: 2rem;
}

.admin-content {
    padding: 2rem;
}

/* Admin page h5 headings - visual segmentation */
/* Only apply to admin pages, not public pages */
body:has(.admin-sidebar) h5,
body:has(.admin-content) h5 {
    background: #b8b8b8;
    padding: 0.75rem 1rem;
    border-radius: 0;
    font-weight: 600;
    color: #262626;
}

/* ===== Unified Stat Cards - Design 4: Colored Header ===== */
.stat-card, .stats-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}
/* Clickable stat cards (links or onclick handlers) */
.stat-card.clickable, .stats-card.clickable,
a.stat-card, a.stats-card {
    cursor: pointer;
}
.stat-card.clickable:hover, .stats-card.clickable:hover,
a.stat-card:hover, a.stats-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}
.stat-card .stat-header, .stats-card .stat-header {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-card .stat-header .stat-icon, .stats-card .stat-header .stat-icon {
    font-size: 1.25rem;
    opacity: 0.85;
    color: inherit;
    order: 2;
}
.stat-card .stat-header .stat-label, .stats-card .stat-header .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    font-weight: 600;
    color: inherit;
}
.stat-card .stat-body, .stats-card .stat-body {
    padding: 1rem;
}
.stat-card .stat-body .stat-value, .stats-card .stat-body .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: #212529;
}
.stat-card .stat-body small, .stats-card .stat-body small {
    font-size: 0.75rem;
    color: #6c757d;
}
/* Header color variants */
.stat-card.primary .stat-header, .stats-card.primary .stat-header { background: linear-gradient(135deg, #007bff 0%, #0056b3 100%); color: #fff; }
.stat-card.success .stat-header, .stats-card.success .stat-header { background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%); color: #fff; }
.stat-card.warning .stat-header, .stats-card.warning .stat-header { background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%); color: #212529; }
.stat-card.danger .stat-header, .stats-card.danger .stat-header { background: linear-gradient(135deg, #dc3545 0%, #c82333 100%); color: #fff; }
.stat-card.info .stat-header, .stats-card.info .stat-header { background: linear-gradient(135deg, #17a2b8 0%, #138496 100%); color: #fff; }
.stat-card.secondary .stat-header, .stats-card.secondary .stat-header { background: linear-gradient(135deg, #6c757d 0%, #545b62 100%); color: #fff; }

/* Compact stat card for dual values */
.stat-card.stat-card-compact .stat-body {
    padding: 0.5rem 1rem;
}
.stat-card .stat-value-dual {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #212529;
}
.stat-card .stat-value-dual small {
    font-size: 0.7rem;
    color: #6c757d;
}

/* ===== Quick Action Cards ===== */
.action-card {
    display: flex;
    align-items: stretch;
    background: white;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    overflow: hidden;
    height: 100%;
}
.action-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-3px);
    text-decoration: none;
    color: inherit;
}
.action-card .action-icon {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}
.action-card.primary .action-icon { background: linear-gradient(135deg, #0d6efd, #0a58ca); }
.action-card.success .action-icon { background: linear-gradient(135deg, #198754, #146c43); }
.action-card.warning .action-icon { background: linear-gradient(135deg, #ffc107, #e0a800); color: #212529; }
.action-card.info .action-icon { background: linear-gradient(135deg, #0dcaf0, #0aa2c0); }
.action-card.danger .action-icon { background: linear-gradient(135deg, #dc3545, #b02a37); }
.action-card.secondary .action-icon { background: linear-gradient(135deg, #6c757d, #565e64); }
.action-card.purple .action-icon { background: linear-gradient(135deg, #6f42c1, #59359a); }
.action-card.dark .action-icon { background: linear-gradient(135deg, #212529, #343a40); }
.action-card .action-text {
    flex: 1;
    padding: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}
.action-card .action-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.action-card .action-content .action-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.action-card .action-content .action-desc {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
}

/* ===== Tables ===== */
.table-hover tbody tr {
    transition: background-color 0.2s;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.table-actions {
    white-space: nowrap;
    text-align: right;
}

.table-actions .btn {
    margin-right: 0.25rem;
}

/* ===== Unified Data Table ===== */
.data-table-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.data-table {
    margin-bottom: 0;
}

.data-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6c757d;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    cursor: default;
}

.data-table th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.data-table th[data-sort]:hover {
    background-color: rgba(0,0,0,0.03);
}

.data-table td {
    vertical-align: middle;
}

.data-table .sort-icon {
    font-size: 0.7rem;
    opacity: 0.5;
    margin-left: 0.25rem;
}

.data-table th[data-sort]:hover .sort-icon {
    opacity: 1;
}

.data-table th.sort-asc .sort-icon::before {
    content: "\F282"; /* bi-chevron-up */
}

.data-table th.sort-desc .sort-icon::before {
    content: "\F286"; /* bi-chevron-down */
}

.data-table th.sort-asc .sort-icon,
.data-table th.sort-desc .sort-icon {
    opacity: 1;
    color: var(--bs-primary);
}

/* Signature thumbnail in data tables */
.signature-thumb {
    width: 80px;
    height: 40px;
    object-fit: contain;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}

.signature-thumb:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gps-badge {
    background: #28a745;
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    font-size: 0.7rem;
}

/* ===== Drag & Drop / Sortable ===== */
.drag-handle {
    cursor: move;
    color: #adb5bd;
}

.drag-handle:hover {
    color: #6c757d;
}

.sortable-ghost {
    opacity: 0.4;
    background-color: #e9ecef;
}

/* ===== Icon Picker ===== */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.icon-picker-item {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-picker-item:hover,
.icon-picker-item.selected {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.icon-picker-item i {
    font-size: 1.25rem;
}

/* ===== Collapsible Group Cards ===== */
.group-card {
    margin-bottom: 1rem;
}

.group-card .card-header {
    cursor: pointer;
    background-color: #f8f9fa;
}

.group-card .card-header.collapsed {
    border-bottom: none;
}

.group-card .group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.group-card .group-actions {
    margin-left: auto;
}

.group-card.ungrouped .card-header {
    border-left: 3px solid #6c757d;
}

/* ===== Attribute Display ===== */
.attribute-icon {
    font-size: 1.25rem;
    width: 2rem;
    text-align: center;
}

.type-badge {
    font-size: 0.75rem;
    font-weight: normal;
}

.scope-indicator {
    font-size: 0.75rem;
}

/* ===== Badges ===== */
.badge-new {
    background: #28a745;
}

.badge-sale {
    background: #dc3545;
}

.badge-hot {
    background: #ff6b6b;
}

.badge-featured {
    background: #ffc107;
    color: #000;
}

.badge-low-stock {
    background: #fd7e14;
}

.badge-out-of-stock {
    background: #6c757d;
}

/* ===== Buttons ===== */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.required-field::after {
    content: ' *';
    color: #dc3545;
}

/* ===== Product Cards ===== */
.product-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 10px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
/*    padding-top: 100%; */
    background: #f8f9fa;
}

.product-card .product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.product-card .product-info {
    padding: 1rem;
}

.product-card .product-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card .product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #667eea;
}

.product-card .product-price-old {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 1rem;
    margin-right: 0.5rem;
}

/* ===== Shopping Cart ===== */
.cart-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.cart-summary .summary-total {
    font-size: 1.5rem;
    font-weight: bold;
    border-top: 2px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* ===== Order Status Timeline ===== */
.order-timeline {
    position: relative;
    padding-left: 2rem;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.order-timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.order-timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dee2e6;
    border: 3px solid white;
}

.order-timeline-item.active::before {
    background: #667eea;
}

.order-timeline-item.completed::before {
    background: #28a745;
}

/* ===== Loading Spinner ===== */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* ===== Alerts & Notifications ===== */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Responsive Utilities ===== */
@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }

    .auth-card {
        margin: 1rem;
    }

    .admin-content {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* ===== Utility Classes ===== */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm-hover {
    transition: box-shadow 0.2s;
}

.shadow-sm-hover:hover {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.overflow-hidden {
    overflow: hidden;
}

/* ===== Dashboard Charts ===== */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 2rem;
}

/* ===== File Upload ===== */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-upload-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-upload-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.file-upload-label:hover {
    background: #764ba2;
}

/* ===== Image Preview (Admin Upload Areas) ===== */
.image-preview {
    width: 200px;
    height: 200px;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.image-preview:hover {
    border-color: #2a5298;
    background-color: #f8f9fa;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

/* ===== Signature Pad ===== */
.signature-pad {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: crosshair;
}

/* ===== Mobile Delivery Interface ===== */
.mobile-delivery-card {
    margin-bottom: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-delivery-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px 10px 0 0;
}

.delivery-stop {
    padding: 1rem;
    border-left: 4px solid #dee2e6;
    margin-bottom: 1rem;
    background: white;
    border-radius: 4px;
}

.delivery-stop.completed {
    border-left-color: #28a745;
    opacity: 0.7;
}

.delivery-stop.pending {
    border-left-color: #ffc107;
}

.settings-nav {
    border-right: 1px solid #dee2e6;
}
.settings-nav .nav-link {
    color: #495057 !important;
    padding: 1rem 1.5rem;
    border-left: 3px solid transparent;
}
.settings-nav .nav-link:hover {
    background: #f8f9fa;
    border-left-color: #2a5298;
}
.settings-nav .nav-link.active {
    background: #e9ecef;
    border-left-color: #2a5298;
    color: #2a5298;
    font-weight: 600;
}

/* ===== Membership Pages ===== */
/* Shared styles for all membership pages (tiers, benefits, requests) */
.membership-page body {
    background: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.membership-page .main-content {
    padding: 2rem;
}

.membership-page .card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Tier badges */
.tier-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}

/* Tier filter radio buttons (benefits page) */
.tier-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tier-radio {
    display: none;
}

.tier-radio-label {
    padding: 0.5rem 1.25rem;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    font-weight: 500;
}

.tier-radio-label:hover {
    border-color: #0d6efd;
    background: #f8f9fa;
}

.tier-radio:checked + .tier-radio-label {
    border-color: #0d6efd;
    background: #0d6efd;
    color: white;
}

.tier-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

/* Request cards (requests page) */
.request-card {
    border-left: 5px solid;
    transition: all 0.3s;
}

.request-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.request-pending {
    border-left-color: #ffc107;
}

.request-approved {
    border-left-color: #28a745;
}

.request-rejected {
    border-left-color: #dc3545;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
}

/* Filter tabs (requests page) */
.filter-tabs .nav-link {
    border-radius: 10px 10px 0 0;
    color: #495057;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    margin-right: 0.25rem;
}

.filter-tabs .nav-link:hover {
    background: #dee2e6;
    color: #212529;
}

.filter-tabs .nav-link.active {
    background: white;
    border-bottom-color: white;
    color: #0d6efd;
    font-weight: 600;
}

/* Table hover effect for membership pages */
.membership-page .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* ===== Image Modal (80% Viewport) ===== */
.modal-image-80 .modal-dialog {
    width: 80vw;
    max-width: 80vw;
    height: 50vh;
    max-height: 50vh;
    margin: 10vh auto;
    top: 1rem;
}

.modal-image-80 .modal-content {
    height: 90%;
    display: flex;
    flex-direction: column;
}

.modal-image-80 .modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-80 .modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ===== Print Styles ===== */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}

/* Alapértelmezett beállítások (kis képernyőkön és md alatt) */
.gdpr-toast-sizing {
    width: 100% !important; /* Mobil nézetben mindig 100% */
    max-width: 80vw !important; /* Maximum a nézet 90%-át foglalja el */
}

/* Képernyőméret: Közepes (md) és afelett (768px +) */
@media (max-width: 768px) {
    .gdpr-toast-sizing {
        /* A fix szélesség beállítása (pl. 350px) */
        width: 450px !important;
    }
}

/* ===== Settings Pages Base Styles ===== */
.settings-page {
    background: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Settings Three-Panel Layout */
.settings-page .main-content {
    margin-left: 490px !important; /* 240px sidebar + 250px settings nav */
    width: calc(100% - 490px) !important;
    padding: 1.5rem;
}

.settings-secondary-nav {
    position: fixed;
    top: 0;
    left: 240px;
    width: 250px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    z-index: 1000;
    padding-top: 1rem;
    padding-bottom: 2rem;
    transition: left 0.3s ease;
}

.settings-secondary-nav .nav-header {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-secondary-nav .nav-link {
    display: block;
    padding: 0.4rem 1rem;
    color: #495057;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.settings-secondary-nav .nav-link:hover {
    background: #f8f9fa;
    color: #2a5298;
}

.settings-secondary-nav .nav-link.active {
    background: #e3f2fd;
    border-left-color: #0d6efd;
    color: #0d6efd;
    font-weight: 500;
}

.settings-secondary-nav .nav-link i {
    width: 20px;
    margin-right: 0.5rem;
}

.settings-secondary-nav .nav-divider {
    height: 1px;
    background: #dee2e6;
    margin: 0.5rem 1rem;
}

/* Settings Nav Toggle Button */
.settings-nav-toggle {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.settings-nav-toggle:hover {
    background: #e9ecef;
    color: #495057;
}

.settings-secondary-nav.collapsed .settings-nav-toggle i {
    transform: rotate(180deg);
}

/* Settings Secondary Nav Collapsed State */
.settings-secondary-nav.collapsed {
    width: 60px;
}

.settings-secondary-nav.collapsed .nav-header {
    padding: 0.3rem 0.5rem;
    justify-content: center;
}

/* Hide header text in collapsed mode */
.settings-secondary-nav.collapsed .nav-header {
    font-size: 0;
    color: transparent;
}

/* But keep toggle button visible */
.settings-secondary-nav.collapsed .settings-nav-toggle {
    font-size: 1rem;
    color: #6c757d;
}

.settings-secondary-nav.collapsed .nav-link {
    padding: 0.3rem 0.5rem;
    text-align: center;
    border-left: none;
    border-bottom: 2px solid transparent;
}

.settings-secondary-nav.collapsed .nav-link i {
    width: auto;
    margin-right: 0;
    font-size: 1.1rem;
}

.settings-secondary-nav.collapsed .nav-link span,
.settings-secondary-nav.collapsed .nav-link:not(i) {
    font-size: 0;
}

/* Hide text in collapsed mode - keep only icons */
.settings-secondary-nav.collapsed .nav-link {
    font-size: 0;
}

.settings-secondary-nav.collapsed .nav-link i {
    font-size: 1.1rem;
}

.settings-secondary-nav.collapsed .nav-link.active {
    background: #e3f2fd;
    border-left: none;
    border-radius: 4px;
    margin: 0 0.5rem;
}

/* Visual group separators in collapsed mode */
.settings-secondary-nav.collapsed .nav-divider {
    height: 2px;
    margin: 0.4rem 0.5rem;
    background: #adb5bd;
}

/* Responsive: Hide secondary nav on tablet/mobile */
@media (max-width: 991.98px) {
    .settings-secondary-nav {
        display: none;
    }
    .settings-page .main-content {
        margin-left: 0;
    }
}

/* When primary sidebar is collapsed */
.settings-secondary-nav.sidebar-collapsed {
    left: 70px;
}
.settings-page.sidebar-collapsed .main-content {
    margin-left: 320px !important; /* 70px + 250px */
    width: calc(100% - 320px) !important;
}

/* When secondary nav is collapsed */
.settings-page.settings-nav-collapsed .main-content {
    margin-left: 300px !important; /* 240px + 60px */
    width: calc(100% - 300px) !important;
}

/* When both primary sidebar AND secondary nav are collapsed */
.settings-page.sidebar-collapsed.settings-nav-collapsed .main-content {
    margin-left: 130px !important; /* 70px + 60px */
    width: calc(100% - 130px) !important;
}

.settings-page .card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.settings-page .form-label {
    font-weight: 600;
    color: #495057;
}

.settings-page .help-text {
    font-size: 0.875rem;
    color: #6c757d;
}

.settings-page .settings-nav {
    border-right: 1px solid #dee2e6;
}

.settings-page .settings-nav .nav-link {
    color: #495057;
    padding: 1rem 1.5rem;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.settings-page .settings-nav .nav-link:hover {
    background: #f8f9fa;
    border-left-color: #2a5298;
}

.settings-page .settings-nav .nav-link.active {
    background: #e9ecef;
    border-left-color: #2a5298;
    color: #2a5298;
    font-weight: 600;
}

.settings-page .settings-nav .nav-link i {
    width: 20px;
    margin-right: 10px;
}

/* Settings page card headers - darker background */
.settings-page .card-header {
    background-color: #e2e6ea !important;
}

.settings-page .card-header h5,
.settings-page .card-header h6 {
    margin-bottom: 0;
}

.settings-page .color-preview {
    width: 50px;
    height: 38px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
}

.settings-page .preset-btn {
    margin-bottom: 0.5rem;
}

.settings-page .password-toggle {
    cursor: pointer;
}

/* Access Matrix Table Styles */
.settings-page .access-matrix-table {
    font-size: 0.875rem;
}

.settings-page .access-matrix-table th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
}

.settings-page .access-matrix-table thead th:first-child {
    left: 0;
    z-index: 11;
}

.settings-page .access-matrix-table tbody th {
    position: sticky;
    left: 0;
    background: white;
    font-weight: 500;
    z-index: 9;
    white-space: nowrap;
}

.settings-page .access-matrix-table td {
    text-align: center;
    vertical-align: middle;
}

.settings-page .table-wrapper {
    max-height: 600px;
    overflow: auto;
}

.settings-page .role-header {
    writing-mode: horizontal-tb;
    min-width: 80px;
}

.settings-page .checkbox-cell input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.settings-page .select-all-col {
    cursor: pointer;
}

.settings-page .access-type-switch {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.settings-page .access-type-switch .form-check {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.settings-page .access-type-switch .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    cursor: pointer;
    margin: 0;
}

.settings-page .access-type-switch small {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.settings-page .access-type-switch .text-readonly {
    color: #0dcaf0;
}

.settings-page .access-type-switch .text-write {
    color: #198754;
}

.settings-page .permission-cell {
    text-align: center;
    vertical-align: middle;
}

.settings-page .checkbox-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== External Integrations Page ===== */

/* Progress bar container */
.subscribers-progress {
    height: 24px;
    max-width: 350px;
}

.subscribers-progress-text {
    line-height: 24px;
    font-weight: 500;
    color: #333;
}

/* Modal table containers */
.modal-table-scroll {
    max-height: 350px;
    overflow-y: auto;
}

.modal-table-scroll-lg {
    max-height: 400px;
    overflow-y: auto;
}

/* Large icon in empty states */
.modal-icon-lg {
    font-size: 3rem;
}

/* Table checkbox column */
.col-checkbox {
    width: 40px;
}

/* Progress bar initial state */
.progress-bar-zero {
    width: 0%;
}

/* ===== Toast and Modal z-index ===== */
.toast-container-top {
    z-index: 99999;
}

.modal-high-z {
    z-index: 9999;
}

/* ===== Admin Navbar ===== */
.admin-top-navbar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1040;
}

.admin-top-navbar .container-fluid {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.admin-top-navbar .bi-list {
    font-size: 1.5rem;
}

.admin-top-navbar .navbar-brand,
.admin-top-navbar .nav-link {
    color: white !important;
}
/* ============================================ */
/* DELIVERY MAP STYLES                         */
/* ============================================ */

/* Map container */
.delivery-map-container {
    width: 100%;
    height: 400px;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.delivery-map-container.large {
    height: 500px;
}

.delivery-map-container.fullscreen {
    height: calc(100vh - 200px);
    min-height: 400px;
}

/* Numbered markers */
.delivery-marker-container {
    background: transparent;
}

.delivery-marker {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: #0d6efd;
    position: relative;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.delivery-marker .marker-number {
    transform: rotate(45deg);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.delivery-marker.pending {
    background: #0d6efd;
}

.delivery-marker.in_progress {
    background: #fd7e14;
}

.delivery-marker.completed {
    background: #198754;
}

.delivery-marker.failed {
    background: #dc3545;
}

/* Driver location pulsing marker */
.driver-location-marker {
    background: transparent;
}

.driver-dot {
    width: 12px;
    height: 12px;
    background: #0d6efd;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.driver-pulse {
    width: 30px;
    height: 30px;
    background: rgba(13, 110, 253, 0.3);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: driver-pulse 2s ease-out infinite;
}

@keyframes driver-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Map legend */
.map-legend {
    background: white;
    padding: 10px 15px;
    border-radius: 0.375rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.map-legend-item:last-child {
    margin-bottom: 0;
}

.map-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.map-legend-dot.pending { background: #0d6efd; }
.map-legend-dot.completed { background: #198754; }
.map-legend-dot.failed { background: #dc3545; }
.map-legend-dot.driver { background: #fd7e14; }

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 0.375rem;
}

.leaflet-popup-content {
    margin: 10px 12px;
    font-size: 0.875rem;
}

/* Marker cluster custom styles */
.marker-cluster-custom {
    background: transparent;
}

.cluster-marker {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

.cluster-marker span {
    font-size: 14px;
    line-height: 1;
}

.cluster-marker .cluster-sequences {
    font-size: 9px;
    font-weight: normal;
    opacity: 0.9;
    line-height: 1;
    margin-top: 2px;
}

.cluster-marker.cluster-small {
    background: #0d6efd;
}

.cluster-marker.cluster-medium {
    background: #fd7e14;
}

.cluster-marker.cluster-large {
    background: #dc3545;
}


/* ===== Storage / Warehouse Management Styles ===== */

/* Scrap Report - smaller chart height for dashboard layout */
.scrap-report-page .chart-container {
    height: 250px;
}

/* Stock Transfers */
.storage-transfers-page .transfer-arrow {
    font-size: 1.2rem;
    color: #6c757d;
}

/* Storage Settings */
.storage-settings-page #reasonsTable .reason-slug {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.zip-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.zip-autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid #f0f0f0;
}

.zip-autocomplete-item:hover {
    background-color: #f8f9fa;
}

.zip-autocomplete-item:last-child {
    border-bottom: none;
}
