/**
 * Custom CSS Overrides for TOSSET Platform
 * Fixes header spacing and updates color scheme
 */

/* Fix header spacing issue - add padding-top to body to account for fixed header */
body {
   /* padding-top: 100px;*/
}

@media (max-width: 991px) {
    body {
        padding-top: 80px;
    }
}

/* Inner section spacing adjustment */
.inner-section {
    padding-top: 40px;
    padding-bottom: 60px;
}

/* Update base color from #0d6efd to rgba(10,9,48,0.65) */
/* Background colors (except buttons and badges) */
.bg-primary:not(.btn):not(.badge) {
    background-color:rgba(43, 109, 236, 0.65) !important;
}

/* Text colors */
.text-primary {
    color: rgba(10,9,48,0.9) !important;
}

/* Border colors */
.border-primary {
    border-color: rgba(10,9,48,0.65) !important;
}

/* Alert backgrounds (except buttons) */
.alert-primary {
    background-color: rgba(10,9,48,0.1);
    border-color: rgba(10,9,48,0.2);
    color: rgba(10,9,48,0.9);
}

/* Card and panel accents */
.card.border-left-primary {
    border-left-color: rgba(10,9,48,0.65) !important;
}

/* Form inputs focus state */
.form-control:focus,
.form-select:focus {
    border-color: rgba(10,9,48,0.5);
    box-shadow: 0 0 0 0.25rem rgba(10,9,48,0.15);
}

/* Account card active states */
.account-list li a.active,
.account-list li a:hover {
    background: rgba(10,9,48,0.1);
    color: rgba(10,9,48,0.9);
}

.account-list li a.active i {
    color: rgba(10,9,48,0.9);
}

/* Dashboard sidebar active */
.sidebar-nav .nav-link.active {
    background: rgba(10,9,48,0.1);
    color: rgba(10,9,48,0.9);
}

/* Progress bars */
.progress-bar {
    background-color: rgba(10,9,48,0.65);
}

/* Badges (keep original button colors) */
.badge.bg-primary {
    background-color: #477CDB !important;
}

/* Links */
a:not(.btn):not(.nav-link) {
    color: rgba(10,9,48,0.85);
}

a:not(.btn):not(.nav-link):hover {
    color: rgba(10,9,48,1);
}

/* Table stripes and hovers */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(10,9,48,0.03);
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(10,9,48,0.05);
}

/* List group items */
.list-group-item.active {
    background-color: rgba(10,9,48,0.65);
    border-color: rgba(10,9,48,0.65);
}

/* Nav tabs */
.nav-tabs .nav-link.active {
    color: rgba(10,9,48,0.9);
    border-color: #dee2e6 #dee2e6 #fff;
}

.nav-pills .nav-link.active {
    background-color: rgba(10,9,48,0.65);
}

/* Pagination */
.pagination .page-item.active .page-link {
    background-color: rgba(10,9,48,0.65);
    border-color: rgba(10,9,48,0.65);
}

.pagination .page-link {
    color: rgba(10,9,48,0.85);
}

.pagination .page-link:hover {
    color: rgba(10,9,48,1);
    background-color: rgba(10,9,48,0.1);
}

/* Dropdown active items */
.dropdown-item.active,
.dropdown-item:active {
    background-color: rgba(10,9,48,0.65);
}

/* Modal header */
.modal-header {
    border-bottom-color: rgba(10,9,48,0.1);
}

/* Carousel indicators */
.carousel-indicators [data-bs-target] {
    background-color: rgba(10,9,48,0.5);
}

.carousel-indicators .active {
    background-color: rgba(10,9,48,0.9);
}

/* Tooltip and popover */
.tooltip .tooltip-inner {
    background-color: rgba(10,9,48,0.9);
}

/* Spinners */
.spinner-border {
    border-color: rgba(10,9,48,0.25);
    border-right-color: transparent;
}

/* Section headings */
.section-heading h2 {
    color: rgba(10,9,48,0.9);
}

/* Account card titles */
.account-title h4 {
    color: rgba(10,9,48,0.9);
}

/* Dashboard stats card icons - keep varied colors */
.product-icon {
    /* Keep original varied colors for visual interest */
}

/* Fix single banner spacing */
.single-banner {
    margin-top: 0;
}

/* Ensure content is readable */
.account-card {
    margin-bottom: 30px;
}

/* Footer spacing */
.footer-part {
    margin-top: 60px;
}

/* Fix breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    body {
        padding-top: 70px;
    }
    
    .inner-section {
        padding-top: 30px;
        padding-bottom: 40px;
    }
}

/* Fix z-index issues */
.header-part {
    z-index: 1050;
}

.sidebar-part {
    z-index: 1060;
}

.backdrop {
    z-index: 1055;
}

/* Smooth transitions */
.account-card,
.product-card,
.contact-card {
    transition: all 0.3s ease;
}

/* Hover effects */
.product-card:hover,
.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(10,9,48,0.15);
}

/* Form validation states with new color */
.is-valid {
    border-color: #28a745;
}

.is-invalid {
    border-color: #dc3545;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: rgba(10,9,48,0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(10,9,48,0.5);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty states */
.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state i { 
    color: rgba(10,9,48,0.2);
    margin-bottom: 20px;
}

/* Success/Error messages */
.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.2);
    color: #155724;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #721c24;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.alert-info {
    background-color: rgba(10,9,48,0.1);
    border-color: rgba(10,9,48,0.2);
    color: rgba(10,9,48,0.9);
}

/* ======================================
   MOBILE BOTTOM NAVIGATION
   ====================================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    display: none;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    border-top: 1px solid rgba(0,0,0,0.08);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 6px 8px;
    color: #666;
    text-decoration: none;
    font-size: 11px;
    transition: all 0.2s ease;
    position: relative;
    min-width: 60px;
    max-width: 80px;
}

.mobile-nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.mobile-nav-item span {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
    color: #477CDB;
    text-decoration: none;
}

.mobile-nav-item.active {
    color: #477CDB;
}

.mobile-nav-item.active i {
    transform: scale(1.1);
}

.mobile-nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: #ff4444;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
}

/* Show only on mobile devices */
@media (max-width: 767px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* Add padding to body to prevent content from being hidden behind nav */
    body {
        padding-bottom: max(60px, calc(60px + env(safe-area-inset-bottom)));
    }
    
    /* Adjust footer to account for mobile nav */
    .footer-part {
        margin-bottom: 20px;
    }
}

/* Auth page fixes for small screens and 1024x768 */
.auth-body { overflow-y: auto !important; }
.auth-part { min-height: 100vh; }
.auth-form { height: auto !important; min-height: 100vh; }
.auth-form-content { overflow-y: auto !important; max-height: none !important; }
@media (min-height: 600px) and (max-height: 850px) {
  .auth-form-content { padding: 20px 20px; }
}

/* Models page grid and cards */
.models-full-bleed { padding-left: 10px; padding-right: 10px; }
.models-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; }
@media (max-width: 1400px){ .models-grid{ grid-template-columns: repeat(5,1fr);} }
@media (max-width: 1200px){ .models-grid{ grid-template-columns: repeat(4,1fr);} }
@media (max-width: 992px){ .models-grid{ grid-template-columns: repeat(3,1fr);} }
@media (max-width: 768px){ .models-grid{ grid-template-columns: repeat(2,1fr);} }
@media (max-width: 576px){ .models-grid{ grid-template-columns: repeat(1,1fr);} }
.simple-card{position:relative; display:flex; flex-direction:column; text-decoration:none;}
.simple-img{width:100%; height:320px; object-fit:cover; border-radius:8px; overflow:hidden;}
.simple-img.placeholder{display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#667eea 0%,#764ba2 100%); color:#fff; font-weight:700; font-size:42px; border-radius:8px;}
.hover-info{position:absolute; inset:0; background:rgba(0,0,0,.85); color:#fff; display:flex; align-items:center; justify-content:center; opacity:0; visibility:hidden; transition:opacity .2s ease; border-radius:8px;}
.simple-card:hover .hover-info{opacity:1; visibility:visible;}
.hover-content ul{list-style:none; padding:0; margin:0; line-height:1.7; font-size:14px;}
.hover-content strong{min-width:80px; display:inline-block; font-weight:700;}
.simple-caption{text-align:center; margin-top:10px; font-weight:700; letter-spacing:.08em; color:#0a0930; text-transform:uppercase; min-height:22px;}
.hover-actions{margin-top:12px; display:flex; flex-wrap:wrap; gap:8px; justify-content:center;}

/* Models hero */
.hero-section-models { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); position: relative; overflow: visible; padding-bottom: 2rem; }
.hero-section-models::before { content: ''; position: absolute; inset: 0; background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%23ffffff08" points="0,500 250,300 500,400 750,200 1000,300 1000,1000 0,1000"/></svg>'); background-size: cover; }

/* Compact pager */
.compact-pager .d-inline-flex.gap-3 a { display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:999px; background:#fff; border:1px solid #e5e7eb; color:#0a0930 !important; text-decoration:none; font-weight:600; box-shadow:0 4px 10px rgba(0,0,0,0.05); transition:all .2s ease; }
.compact-pager .d-inline-flex.gap-3 a:hover { background: linear-gradient(135deg, rgba(102,126,234,.08) 0%, rgba(118,75,162,.08) 100%); border-color:#cfd6f6; transform:translateY(-1px); }
.compact-pager .d-inline-flex.gap-3 a.disabled { opacity:.5; pointer-events:none; filter:grayscale(.2); }
.compact-pager .d-inline-flex.gap-3 a:nth-child(1)::before { content: '\00AB'; opacity:.7; }
.compact-pager .d-inline-flex.gap-3 a:nth-child(2)::before { content: '\2039'; opacity:.7; }
.compact-pager .d-inline-flex.gap-3 a:nth-child(3)::after { content: '\203A'; opacity:.7; }
.compact-pager .d-inline-flex.gap-3 a:nth-child(4)::after { content: '\00BB'; opacity:.7; }
.compact-pager .text-muted.small { color:#6b7280 !important; background:#fff; display:inline-block; padding:6px 12px; border-radius:8px; border:1px dashed #e5e7eb; }

/* Admin: small avatar utilities */
.avatar-50{ width:50px; height:50px; object-fit:cover; border-radius:50%; }
.avatar-50.placeholder{ display:flex; align-items:center; justify-content:center; width:50px; height:50px; border-radius:50%; background:#6c757d; color:#fff; }

/* Admin: homepage slider thumb */
.slide-thumb{ width:100%; height:200px; object-fit:cover; }

/* Tablet breakpoint - optional, can hide on tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .mobile-bottom-nav {
        display: none; /* Hide on tablets, or set to flex if you want it visible */
    }
}

/* iOS safe area support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

/* Animation on page load */
.mobile-bottom-nav {
    animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fix notification & account dropdowns on small screens */
@media (max-width: 767px) {
    .header-notification .notification-dropdown {
        position: fixed !important;
        top: 70px !important;
        right: 12px !important;
        left: 12px !important;
        max-height: calc(100vh - 90px) !important;
        overflow-y: auto !important;
        z-index: 1200 !important;
        transform: none !important;
    }

    /* Force the user dropdown to be a full visible panel on mobile */
    header.header-part .header-user .header-user-dropdown {
        position: fixed !important;
        top: 70px !important;
        right: 12px !important;
        left: 12px !important;
        max-height: calc(100vh - 90px) !important;
        overflow-y: auto !important;
        z-index: 1200 !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}
