/*
 * MumasaHost Pro Theme v4.0 - Override Styles
 * Bootstrap & Component Overrides
 * Updated: 2026
 */

/* ============================================
   BOOTSTRAP COMPONENT OVERRIDES
   ============================================ */

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    background: var(--bg-primary);
    min-width: 200px;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.dropdown-item.active {
    background: var(--primary);
    color: white;
}

.dropdown-divider {
    border-color: var(--border-primary);
    margin: 0.5rem;
}

.dropdown-header {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 0.5rem 1rem;
}

/* Modal */
.modal-content {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    background: var(--bg-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-primary);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-primary);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    opacity: 0.5;
    transition: all var(--transition-fast);
}

.btn-close:hover {
    opacity: 1;
    background: var(--bg-secondary);
}

/* Toast */
.toast {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    background: var(--bg-primary);
}

.toast-header {
    border-bottom: 1px solid var(--border-primary);
    padding: 0.875rem 1rem;
    background: transparent;
}

.toast-body {
    padding: 1rem;
}

/* Tooltip */
.tooltip {
    --bs-tooltip-bg: var(--gray-900);
    --bs-tooltip-color: white;
}

/* Popover */
.popover {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    background: var(--bg-primary);
}

.popover-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.popover-body {
    padding: 1.25rem;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    gap: 0.375rem;
}

.page-link {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.625rem 1rem;
    transition: all var(--transition-fast);
    background: var(--bg-primary);
}

.page-link:hover {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
    color: var(--primary);
    z-index: 2;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-item.disabled .page-link {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-muted);
}

/* Breadcrumb */
.breadcrumb {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

.breadcrumb-item {
    font-weight: 500;
}

.breadcrumb-item a {
    color: var(--text-secondary);
}

.breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* Progress */
.progress {
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    height: 0.75rem;
}

.progress-bar {
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
}

/* List Group */
.list-group {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    overflow: hidden;
}

.list-group-item {
    background: var(--bg-primary);
    border-color: var(--border-primary);
    color: var(--text-secondary);
    padding: 1rem 1.25rem;
    transition: all var(--transition-fast);
}

.list-group-item:hover {
    background: var(--bg-secondary);
}

.list-group-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.list-group-item-action:focus {
    background: var(--bg-secondary);
}

/* Badge */
.badge {
    font-weight: 600;
    padding: 0.5em 0.75em;
    border-radius: var(--radius);
}

.badge.bg-primary { background: var(--primary) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-warning { background: var(--warning) !important; color: white !important; }
.badge.bg-danger { background: var(--danger) !important; }
.badge.bg-info { background: var(--info) !important; }
.badge.bg-secondary { background: var(--text-tertiary) !important; }

/* Alert */
.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.alert-primary {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.alert-success {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--success);
}

.alert-warning {
    background: rgba(var(--warning-rgb), 0.1);
    color: var(--warning);
}

.alert-danger {
    background: rgba(var(--danger-rgb), 0.1);
    color: var(--danger);
}

.alert-info {
    background: rgba(var(--info-rgb), 0.1);
    color: var(--info);
}

/* Nav Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--border-primary);
    gap: 0.5rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.875rem 1.25rem;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

.nav-tabs .nav-link:hover {
    border-color: var(--border-secondary);
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.nav-tabs .nav-link.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

/* Nav Pills */
.nav-pills {
    gap: 0.5rem;
}

.nav-pills .nav-link {
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    transition: all var(--transition-fast);
}

.nav-pills .nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-pills .nav-link.active {
    background: var(--primary);
    color: white;
}

/* ============================================
   ADVANCED COMPONENTS
   ============================================ */

/* Custom Checkbox & Radio */
.form-check-custom {
    padding-left: 0;
}

.form-check-custom .form-check-input {
    float: none;
    margin-left: 0;
    margin-right: 0.75rem;
}

.form-check-custom .form-check-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

/* Switch Toggle */
.form-switch-custom {
    padding-left: 3rem;
}

.form-switch-custom .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    margin-left: -3rem;
    background-color: var(--border-secondary);
    border-color: var(--border-secondary);
}

.form-switch-custom .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-switch-custom .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* Floating Labels Enhancement */
.form-floating-custom .form-control:focus ~ label,
.form-floating-custom .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary);
}

/* Input Group Enhancement */
.input-group-custom .input-group-text {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-secondary);
    font-weight: 500;
}

/* File Upload Custom */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.file-upload:hover .file-upload-label {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
}

/* Select Custom */
.form-select-custom {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-size: 16px 12px;
}

[data-bs-theme="dark"] .form-select-custom {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239CA3AF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* ============================================
   LOADING & SKELETON
   ============================================ */

/* Skeleton Shimmer */
.skeleton-wrapper {
    position: relative;
    overflow: hidden;
}

.skeleton-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* Loading Dots */
.loading-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Spinner Variants */
.spinner-sm { width: 1rem; height: 1rem; border-width: 2px; }
.spinner-md { width: 1.5rem; height: 1.5rem; border-width: 3px; }
.spinner-lg { width: 3rem; height: 3rem; border-width: 4px; }

.spinner-primary { border-top-color: var(--primary); }
.spinner-success { border-top-color: var(--success); }
.spinner-warning { border-top-color: var(--warning); }
.spinner-danger { border-top-color: var(--danger); }

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

/* Glow Effects */
.glow-primary { box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.4); }
.glow-success { box-shadow: 0 0 20px rgba(var(--success-rgb), 0.4); }
.glow-warning { box-shadow: 0 0 20px rgba(var(--warning-rgb), 0.4); }
.glow-danger { box-shadow: 0 0 20px rgba(var(--danger-rgb), 0.4); }

/* Blur Backdrop */
.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Gradient Borders */
.gradient-border {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: var(--primary-gradient);
    border-radius: inherit;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
}

/* Text Shadow */
.text-shadow { text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.text-shadow-lg { text-shadow: 0 4px 8px rgba(0,0,0,0.2); }

/* ============================================
   UTILITY ENHANCEMENTS
   ============================================ */

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Pointer Events */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* User Select */
.user-select-none { user-select: none; }
.user-select-all { user-select: all; }
.user-select-text { user-select: text; }

/* Resize */
.resize-none { resize: none; }
.resize-y { resize: vertical; }
.resize-x { resize: horizontal; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-visible { overflow: visible; }

/* Line Clamp */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Aspect Ratio */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-portrait { aspect-ratio: 3 / 4; }

/* Object Fit */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-fill { object-fit: fill; }

/* ============================================
   DARK MODE SPECIFIC OVERRIDES
   ============================================ */

[data-bs-theme="dark"] .dropdown-menu {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .modal-content {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .popover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .toast {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .skeleton-wrapper::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

[data-bs-theme="dark"] .breadcrumb {
    background: var(--bg-secondary);
}

[data-bs-theme="dark"] .file-upload-label {
    background: var(--bg-secondary);
}

[data-bs-theme="dark"] .file-upload:hover .file-upload-label {
    background: rgba(var(--primary-rgb), 0.1);
}

/* ============================================
   MOBILE RESPONSIVENESS FIXES
   ============================================ */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 576px) {
    /* Auth Pages Mobile Fixes */
    .auth-section {
        padding: 1rem 0 !important;
        min-height: auto !important;
    }
    
    .auth-card {
        padding: 1.25rem !important;
        border-radius: var(--radius-lg) !important;
        margin: 0 0.5rem;
    }
    
    .auth-header {
        margin-bottom: 1.5rem !important;
    }
    
    .auth-header .auth-logo {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .auth-header .auth-logo img,
    .auth-logo-img {
        height: 36px !important;
    }
    
    .auth-header h1 {
        font-size: 1.375rem !important;
        margin-bottom: 0.375rem !important;
    }
    
    .auth-header p {
        font-size: 0.875rem !important;
    }
    
    .auth-footer {
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
    }
    
    /* Form Elements Mobile */
    .form-label {
        font-size: 0.875rem !important;
        margin-bottom: 0.375rem !important;
    }
    
    .form-control,
    .form-select {
        font-size: 1rem !important; /* Prevent zoom on iOS */
        padding: 0.625rem 0.875rem !important;
        min-height: 44px !important; /* Touch friendly */
    }
    
    .input-group-custom .input-group-text {
        padding: 0.625rem 0.875rem !important;
    }
    
    .btn-lg {
        padding: 0.75rem 1.25rem !important;
        font-size: 1rem !important;
    }
    
    /* Navbar Mobile */
    .navbar-brand img,
    .navbar-logo-img {
        height: 32px !important;
    }
    
    .navbar-modern {
        padding: 0.625rem 0 !important;
    }
    
    /* Container Mobile */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Typography Mobile */
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    h4 { font-size: 1.125rem !important; }
    h5 { font-size: 1rem !important; }
    h6 { font-size: 0.9375rem !important; }
    
    body {
        font-size: 0.9375rem !important;
    }
    
    /* Card Mobile */
    .card-modern {
        padding: 1rem !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Section Header Mobile */
    .section-title {
        font-size: 1.625rem !important;
    }
    
    .section-subtitle {
        font-size: 0.9375rem !important;
    }
    
    /* Reduce spacing */
    .mb-4 { margin-bottom: 1rem !important; }
    .mb-5 { margin-bottom: 1.5rem !important; }
    .mt-4 { margin-top: 1rem !important; }
    .mt-5 { margin-top: 1.5rem !important; }
    .py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .py-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .p-4 { padding: 1rem !important; }
    .p-5 { padding: 1.5rem !important; }
    
    /* Accordion Mobile */
    .accordion-button {
        padding: 0.875rem 1rem !important;
        font-size: 0.9375rem !important;
    }
    
    .accordion-body {
        padding: 1rem !important;
    }
    
    /* Table Mobile */
    .table {
        font-size: 0.875rem !important;
    }
    
    /* Dropdown Mobile */
    .dropdown-menu {
        font-size: 0.9375rem !important;
    }
    
    /* Modal Mobile */
    .modal-body {
        padding: 1rem !important;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem !important;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 577px) and (max-width: 768px) {
    .auth-card {
        padding: 1.75rem !important;
    }
    
    .auth-header .auth-logo img,
    .auth-logo-img {
        height: 40px !important;
    }
    
    .navbar-brand img,
    .navbar-logo-img {
        height: 36px !important;
    }
    
    h1 { font-size: 1.875rem !important; }
    h2 { font-size: 1.625rem !important; }
    h3 { font-size: 1.375rem !important; }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 769px) and (max-width: 991px) {
    .navbar-brand img,
    .navbar-logo-img {
        height: 38px !important;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 992px) {
    .navbar-brand img,
    .navbar-logo-img {
        height: 42px !important;
    }
}

/* ============================================
   PRINT OVERRIDES
   ============================================ */

@media print {
    .dropdown-menu,
    .modal,
    .toast,
    .tooltip,
    .popover {
        display: none !important;
    }
}
