/**
 * 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(10,9,48,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 {
    font-size: 4rem;
    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;
    }
}

/* 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;
    }
}
