/* Subsidiary Dealer Management Styles */
/* Place in: themes/support/css/subsidiary-dealers.css */

.subsidiary-dealers {
    background-color: #f8f9fa;
}

.subsidiary-dealers .card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.subsidiary-dealers .card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.subsidiary-dealers .table th {
    border-top: none;
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subsidiary-dealers .table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.subsidiary-dealers .btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.subsidiary-dealers .badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Form Styles */
.subsidiary-dealers .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.subsidiary-dealers .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Status indicators */
.dealer-status-active {
    color: #28a745;
}

.dealer-status-inactive {
    color: #dc3545;
}

.dealer-status-pending {
    color: #ffc107;
}

/* Statistics cards */
.stats-card {
    transition: transform 0.2s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-2px);
}

/* Export functionality styles */
.subsidiary-dealers .export-dropdown .dropdown-toggle {
    position: relative;
}

.subsidiary-dealers .export-dropdown .dropdown-toggle.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.subsidiary-dealers .export-dropdown .dropdown-menu {
    min-width: 200px;
}

.subsidiary-dealers .export-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.15s ease-in-out;
}

.subsidiary-dealers .export-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

.subsidiary-dealers .export-dropdown .dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

.subsidiary-dealers .export-dropdown .dropdown-header {
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
}

.subsidiary-dealers .export-dropdown .dropdown-item-text {
    font-size: 0.75rem;
    line-height: 1.2;
    white-space: normal;
    word-wrap: break-word;
}

/* Export format specific colors */
.subsidiary-dealers .export-dropdown .dropdown-item:nth-child(1) i {
    color: #28a745; /* CSV - Green */
}

.subsidiary-dealers .export-dropdown .dropdown-item:nth-child(2) i {
    color: #17a2b8; /* Excel - Teal */
}

.subsidiary-dealers .export-dropdown .dropdown-item:nth-child(3) i {
    color: #dc3545; /* PDF - Red */
}

/* Export notification styles */
.export-notification {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
}

.export-notification .btn-close {
    filter: invert(1);
}

/* Export progress indicators */
.export-progress {
    position: relative;
    overflow: hidden;
}

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

@keyframes exportLoading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced dropdown styling */
.subsidiary-dealers .btn-group .dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.125);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
}

.subsidiary-dealers .btn-group .dropdown-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .subsidiary-dealers .btn-group {
        flex-direction: column;
    }

    .subsidiary-dealers .btn-group > .btn {
        margin-bottom: 0.25rem;
    }

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

    .subsidiary-dealers .export-dropdown {
        width: 100%;
        margin-top: 0.5rem;
    }

    .subsidiary-dealers .export-dropdown .dropdown-toggle {
        width: 100%;
        justify-content: center;
    }

    .subsidiary-dealers .card-header .row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .subsidiary-dealers .card-header .col-md-4 {
        text-align: center;
    }
}

/* Loading states */
.subsidiary-dealers .loading {
    position: relative;
    pointer-events: none;
}

.subsidiary-dealers .loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced form validation */
.subsidiary-dealers .is-invalid {
    border-color: #dc3545;
}

.subsidiary-dealers .invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Success states */
.subsidiary-dealers .is-valid {
    border-color: #28a745;
}

.subsidiary-dealers .valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #28a745;
}

/* Action buttons styling */
.subsidiary-dealers .action-buttons .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.subsidiary-dealers .action-buttons .btn:last-child {
    margin-right: 0;
}

/* Dealer type badges */
.dealer-type-main { background-color: #007bff; }
.dealer-type-sub { background-color: #28a745; }
.dealer-type-distributor { background-color: #ffc107; color: #212529; }
.dealer-type-service { background-color: #17a2b8; }

/* Pagination improvements */
.subsidiary-dealers .pagination {
    margin-bottom: 0;
}

.subsidiary-dealers .page-link {
    color: #007bff;
    border-color: #dee2e6;
}

.subsidiary-dealers .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* Search form enhancements */
.subsidiary-dealers .search-form {
    position: relative;
}

.subsidiary-dealers .search-form .form-control {
    padding-right: 2.5rem;
}

.subsidiary-dealers .search-form .search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Empty state styling */
.subsidiary-dealers .empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.subsidiary-dealers .empty-state i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Tooltip styling */
.subsidiary-dealers [data-bs-toggle="tooltip"] {
    cursor: help;
}
/* Statistics cards */
.stats-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Clickable stat cards */
.subsidiary-dealers a.text-decoration-none .stats-card {
    cursor: pointer;
}

.subsidiary-dealers a.text-decoration-none:hover .stats-card {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Opacity for external link icons */
.opacity-50 {
    opacity: 0.5;
}

/* Modern Locale Switcher Styles */
.locale-switcher-wrapper {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
}

.locale-switcher-wrapper.loading {
    opacity: 0.8;
    pointer-events: none;
}

.locale-switcher-wrapper .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.locale-switcher-wrapper .form-label i {
    color: #007bff;
    margin-right: 0.5rem;
}

#locale-switcher {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    width: 100%;
    background: white;
}

#locale-switcher:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

#locale-switcher:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

.current-locale-info {
    padding: 0.625rem 0;
    font-size: 0.875rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-locale-info .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.locale-message {
    margin: 0.625rem 0;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
    position: relative;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s ease;
}

.locale-message .message-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.locale-message.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.locale-message.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.locale-message.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.locale-message .close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    padding: 0.25rem;
    color: inherit;
    background: none;
    border: none;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.locale-message .close:hover {
    opacity: 0.75;
}

@media (max-width: 768px) {
    .locale-switcher-wrapper .row {
        flex-direction: column;
        gap: 1rem;
    }

    .current-locale-info {
        text-align: center;
        justify-content: center;
    }
}

/* Fixed Compact Locale Switcher for Navbar */
.locale-switcher-compact {
    margin-left: 1rem;
}

.locale-switcher-compact .fa-globe {
    color: #28a745;
    font-size: 0.9rem;
    vertical-align: middle;
    margin-right: 0.25rem !important;
}

.locale-switcher-compact small {
    white-space: nowrap;
    display: flex;
    align-items: center;
    line-height: 1;
}

.locale-switcher-compact .form-select {
    background-color: #495057 !important;
    border-color: #6c757d !important;
    color: #fff !important;
    font-size: 0.8rem;
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    min-width: 140px;
    transition: all 0.3s ease;
    line-height: 1.2;
}

.locale-switcher-compact .form-select:focus {
    background-color: #5a6268 !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    color: #fff !important;
}

.locale-switcher-compact .form-select:disabled {
    background-color: #3d4043 !important;
    opacity: 0.6;
    cursor: not-allowed;
}

.locale-switcher-compact .form-select option {
    background-color: #495057;
    color: #fff;
}

/* Loading state for compact switcher */
.locale-switcher-compact.loading .form-select {
    position: relative;
    background-color: #3d4043 !important;
}

.locale-switcher-compact.loading .form-select::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border: 1px solid #6c757d;
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s linear infinite;
}

/* Responsive behavior */
@media (max-width: 768px) {
    .locale-switcher-compact {
        margin-left: 0.5rem;
    }

    .locale-switcher-compact .form-select {
        min-width: 120px;
        font-size: 0.75rem;
    }

    .locale-switcher-compact small {
        font-size: 0.7rem;
    }

    .locale-switcher-compact .fa-globe {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .locale-switcher-compact {
        flex-direction: column;
        align-items: flex-start;
        margin-top: 0.25rem;
        margin-left: 0;
    }

    .locale-switcher-compact small {
        margin-bottom: 0.25rem;
        margin-right: 0;
    }

    .locale-switcher-compact .form-select {
        width: 100%;
        min-width: auto;
    }
}

/* Dark theme integration */
@media (prefers-color-scheme: dark) {
    .locale-switcher-compact .form-select {
        background-color: #2d3748 !important;
        border-color: #4a5568 !important;
    }

    .locale-switcher-compact .form-select:focus {
        background-color: #374151 !important;
        border-color: #63b3ed !important;
        box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25);
    }
}

/* Message positioning for compact switcher */
.locale-message.compact {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
