/**
 * Modal Styles - Clean and organized CSS for modal components
 * Provides consistent styling across all modal types
 */

/* ========================================
   MODAL BASE STYLES
======================================== */
.modal {
    z-index: 1055;
}

.modal-dialog {
    margin: 1.75rem auto;
    max-width: 90%;
}

.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1rem 1.5rem;
}

/* ========================================
   PHONE INPUT STYLES
======================================== */

/* Phone Input Container */
.phone-input-container {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    min-height: 56px;
}

.phone-input-container:hover {
    border-color: #bdc3c7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.phone-input-container:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1), 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Country Code Wrapper */
.country-code-wrapper {
    position: relative;
    flex-shrink: 0;
    border-right: 1px solid #e1e8ed;
}

/* Country Code Selector */
.country-code-selector {
    display: flex;
    align-items: center;
    padding: 0 12px;
    min-height: 52px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    min-width: 120px;
}

.country-code-selector:hover {
    background: linear-gradient(135deg, #f1f5f9, #f8fafc);
}

.country-code-selector.active {
    background: linear-gradient(135deg, #eef2ff, #f1f5f9);
}

.country-code-selector.error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

/* Country Flag */
.country-flag {
    font-size: 1.2rem;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

/* Country Code Text */
.country-code-text {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    margin-right: 8px;
}

.country-code-selector.error .country-code-text {
    color: #e74c3c;
}

/* Country Code Dropdown Arrow */
.country-code-selector .dropdown-arrow {
    color: #95a5a6;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.country-code-selector.active .dropdown-arrow {
    transform: rotate(180deg);
    color: #3498db;
}

.country-code-selector.error .dropdown-arrow {
    color: #e74c3c;
}

/* Country Code Menu */
.country-code-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
}

.country-code-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Country Search */
.dropdown-search {
    position: relative;
    padding: 12px;
    border-bottom: 1px solid #e1e8ed;
    background: #f8fafc;
}

.dropdown-search i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    padding: 8px 8px 8px 32px;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #ffffff;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Country List */
.country-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 8px 0;
}

.country-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.country-item:hover {
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border-bottom-color: #e1e8ed;
}

.country-item.selected {
    background: linear-gradient(135deg, #eef2ff, #dbeafe);
    border-bottom-color: #3498db;
}

.country-item .country-flag {
    margin-right: 12px;
    font-size: 1.1rem;
}

.country-item .country-name {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

.country-item .country-code {
    font-weight: 600;
    color: #3498db;
    font-size: 0.85rem;
    margin-left: 8px;
}

/* Phone Number Wrapper */
.phone-number-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

/* Phone Input Icon */
.phone-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 1rem;
    z-index: 1;
}

/* Phone Number Input */
.phone-number-input {
    width: 100%;
    padding: 16px 16px 16px 40px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #2c3e50;
    outline: none;
    transition: all 0.3s ease;
}

.phone-number-input::placeholder {
    color: #95a5a6;
    font-weight: 400;
}

.phone-number-input:focus {
    color: #2c3e50;
}

.phone-number-input.is-invalid {
    color: #e74c3c;
}

/* Input Focus Border */
.phone-number-wrapper .input-focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.phone-input-container:focus-within .input-focus-border {
    transform: scaleX(1);
}

/* Error States */
.phone-input-container.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.phone-input-container.error .country-code-wrapper {
    border-right-color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .phone-input-container {
        flex-direction: column;
        min-height: auto;
    }

    .country-code-wrapper {
        border-right: none;
        border-bottom: 1px solid #e1e8ed;
    }

    .country-code-selector {
        min-height: 48px;
        justify-content: center;
    }

    .country-code-menu {
        position: fixed;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0;
        max-height: 50vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .country-code-menu.show {
        transform: translateY(0);
    }

    .phone-number-wrapper {
        min-height: 48px;
    }

    .phone-number-input {
        padding: 12px 12px 12px 36px;
    }
}

@media (max-width: 576px) {
    .country-code-selector {
        min-width: 100px;
        padding: 0 8px;
    }

    .country-code-text {
        font-size: 0.85rem;
    }

    .phone-number-input {
        font-size: 0.9rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .phone-input-container {
        background: #1e293b;
        border-color: #475569;
    }

    .phone-input-container:hover {
        border-color: #64748b;
    }

    .phone-input-container:focus-within {
        border-color: #3498db;
    }

    .country-code-wrapper {
        border-right-color: #475569;
    }

    .country-code-selector {
        background: linear-gradient(135deg, #334155, #1e293b);
    }

    .country-code-selector:hover {
        background: linear-gradient(135deg, #475569, #334155);
    }

    .country-code-selector.active {
        background: linear-gradient(135deg, #475569, #334155);
    }

    .country-code-text {
        color: #f1f5f9;
    }

    .country-code-menu {
        background: rgba(30, 41, 59, 0.98);
        border-color: #475569;
    }

    .dropdown-search {
        background: #334155;
        border-bottom-color: #475569;
    }

    .search-input {
        background: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }

    .search-input::placeholder {
        color: #94a3b8;
    }

    .country-item:hover {
        background: linear-gradient(135deg, #334155, #475569);
    }

    .country-item.selected {
        background: linear-gradient(135deg, #475569, #334155);
    }

    .country-item .country-name {
        color: #f1f5f9;
    }

    .phone-number-input {
        color: #f1f5f9;
    }

    .phone-number-input::placeholder {
        color: #94a3b8;
    }

    .phone-input-icon {
        color: #94a3b8;
    }
}

/* ========================================
   MODERN FORM STYLES
======================================== */

/* Modern Form Group */
.modern-form-group {
    margin-bottom: 2rem;
    position: relative;
}

/* Modern Label */
.modern-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    letter-spacing: 0.025em;
    transition: color 0.3s ease;
}

.modern-label i {
    color: #3498db;
    font-size: 1rem;
}

/* Modern Input Container */
.modern-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.modern-input-container:hover {
    border-color: #bdc3c7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.modern-input-container:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1), 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Input Icon */
.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #7f8c8d;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.modern-input-container:focus-within .input-icon {
    color: #3498db;
}

/* Modern Input */
.modern-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 14px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.modern-input::placeholder {
    color: #95a5a6;
    font-weight: 400;
    transition: color 0.3s ease;
}

.modern-input:focus::placeholder {
    color: #bdc3c7;
}

/* Focus Border Animation */
.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 0 12px 12px;
}

.modern-input-container:focus-within .input-focus-border {
    width: 100%;
}

/* Error States */
.modern-input-container.is-invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.modern-input-container.is-invalid .input-icon {
    color: #e74c3c;
}

.modern-input-container.is-invalid .input-focus-border {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* Modern Error Message */
.modern-error-message {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    padding: 8px 12px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 8px;
    color: #e74c3c;
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideInError 0.3s ease-out;
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-form-group {
        margin-bottom: 1.5rem;
    }

    .modern-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .modern-input-container {
        border-radius: 10px;
    }

    .input-icon {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .modern-input {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .modern-form-group {
        margin-bottom: 1.25rem;
    }

    .modern-label {
        font-size: 0.85rem;
    }

    .modern-input-container {
        border-radius: 8px;
    }

    .input-icon {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .modern-input {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modern-label {
        color: #ecf0f1;
    }

    .modern-label i {
        color: #3498db;
    }

    .modern-input-container {
        background: #2c3e50;
        border-color: #34495e;
    }

    .modern-input-container:hover {
        border-color: #4a5f7a;
    }

    .modern-input-container:focus-within {
        border-color: #3498db;
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2), 0 4px 16px rgba(0, 0, 0, 0.3);
    }

    .input-icon {
        color: #95a5a6;
    }

    .modern-input-container:focus-within .input-icon {
        color: #3498db;
    }

    .modern-input {
        color: #ecf0f1;
    }

    .modern-input::placeholder {
        color: #7f8c8d;
    }

    .modern-input:focus::placeholder {
        color: #95a5a6;
    }
}
/* ========================================
   FORM STYLES
======================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-select {
    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='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

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

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

/* ========================================
   CAPTCHA STYLES
======================================== */
.captcha {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.captcha-image {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
}

.skeleton-captcha {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    min-width: 120px;
    min-height: 40px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.reloading-capt {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ========================================
   BUTTON STYLES
======================================== */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5c636a;
    border-color: #565e64;
}

.btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-primary:hover:not(:disabled) {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover:not(:disabled) {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* ========================================
   INPUT GROUP STYLES
======================================== */
.input-group-text {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    color: #495057;
    font-weight: 500;
}

.input-group .form-control {
    border-left: 0;
}

.input-group .form-control:focus {
    border-left: 1px solid #ced4da;
    box-shadow: none;
}

.input-group .form-control:focus + .input-group-text {
    border-color: #80bdff;
}

/* ========================================
   MODAL SIZES
======================================== */
.modal-sm {
    max-width: 300px;
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1140px;
}

/* ========================================
   LOADING STATES
======================================== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1001;
}

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

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-lg {
        max-width: calc(100% - 1rem);
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-header,
    .modal-footer {
        padding: 0.75rem 1rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }

    .form-control {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }

    .modal-body {
        padding: 0.75rem;
    }

    .modal-header,
    .modal-footer {
        padding: 0.5rem 0.75rem;
    }

    .captcha {
        flex-direction: column;
        align-items: flex-start;
    }

    .captcha button {
        margin-top: 0.5rem;
    }
}

/* ========================================
   ACCESSIBILITY
======================================== */
.modal[aria-hidden="true"] {
    display: none !important;
}

.modal-backdrop {
    z-index: 1050;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Focus management */
.modal:not(.show) {
    pointer-events: none;
}

.modal.show .modal-dialog {
    pointer-events: auto;
}

/* ========================================
   CUSTOM MODAL TYPES
======================================== */
.modal-help-desk .modal-body {
    background-color: #f8f9fa;
}

.modal-import .modal-body {
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.modal-export .modal-body {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.375rem;
}

.modal-approval .modal-header {
    background-color: #d1ecf1;
    border-bottom-color: #bee5eb;
}

.modal-approval .modal-title {
    color: #0c5460;
}

/* ========================================
   ANIMATIONS - ZOOM IN/OUT
======================================== */
/* Bootstrap Modal Zoom Animations - High specificity to override Bootstrap defaults */
.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease !important;
    transform: scale(0.7) !important;
    opacity: 0 !important;
    transform-origin: center center !important;
}

.modal.show .modal-dialog,
.modal.fade.show .modal-dialog {
    transform: scale(1) !important;
    opacity: 1 !important;
}

.modal.fade:not(.show) .modal-dialog {
    transform: scale(0.7) !important;
    opacity: 0 !important;
}

/* Backdrop fade animation */
.modal-backdrop.fade {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Ensure smooth closing animation */
.modal.fade.modal-static .modal-dialog {
    transform: scale(1.05) !important;
}

/* Support for Bootstrap 5 modal events */
.modal:not(.show) .modal-dialog {
    transform: scale(0.7) !important;
    opacity: 0 !important;
}

/* ========================================
   UTILITY CLASSES
======================================== */
.text-center {
    text-align: center;
}

.text-danger {
    color: #dc3545 !important;
}

.text-muted {
    color: #6c757d !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fst-italic {
    font-style: italic !important;
}

.d-block {
    display: block !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* ========================================
   MODERN PHONE INPUT STYLES - DEPRECATED
   These styles are no longer used for device input
   as we now use the Laravel Tel Input component
======================================== */
.modern-phone-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    position: relative;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02), rgba(118, 75, 162, 0.02));
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.modern-phone-input-container:focus-within {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.country-selector-wrapper {
    position: relative;
    min-width: 160px;
    flex-shrink: 0;
}

.country-selector {
    position: relative;
    cursor: pointer;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.country-selector:hover {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
}

.country-selector.active {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: linear-gradient(135deg, #ffffff, #eef2ff);
}

.selected-country {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #1e293b;
    width: 100%;
}

.selected-country .flag {
    font-size: 1.4rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.selected-country .code {
    font-weight: 700;
    color: #667eea;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}

.dropdown-icon {
    color: #64748b;
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.country-selector.active .dropdown-icon {
    transform: rotate(180deg);
    color: #667eea;
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(102, 126, 234, 0.1);
    z-index: 1000;
    max-height: 320px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.country-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.search-box {
    position: relative;
    padding: 1rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02), rgba(118, 75, 162, 0.02));
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 0.9rem;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    color: #1e293b;
}

.search-box input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.search-box input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.country-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

.country-list::-webkit-scrollbar {
    width: 6px;
}

.country-list::-webkit-scrollbar-track {
    background: transparent;
}

.country-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.country-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.875rem;
    margin-bottom: 0.25rem;
    position: relative;
    overflow: hidden;
}

.country-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.country-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.country-item:hover::before {
    left: 100%;
}

.country-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.1));
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.country-item.highlighted {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.08));
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.country-item .flag {
    font-size: 1.3rem;
    min-width: 1.75rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.country-item .country-name {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
    letter-spacing: 0.025em;
}

.country-item .code {
    font-weight: 700;
    color: #667eea;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.phone-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.modern-input {
    width: 100%;
    padding: 0.875rem 4rem 0.875rem 1rem;
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    color: #1e293b;
    letter-spacing: 0.025em;
}

.modern-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    transform: translateY(-1px);
}

.modern-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
    font-style: italic;
}

.input-icon {
    position: absolute;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
    color: #10b981;
    filter: drop-shadow(0 1px 2px rgba(16, 185, 129, 0.3));
}

.input-validation {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
}

.validation-icon {
    font-size: 1.1rem;
    color: #10b981;
}

.modern-input:valid+.input-icon+.input-validation {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.phone-input-wrapper.focused .modern-input {
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Error states */
.modern-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.country-selector.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.modern-phone-input-container.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(220, 38, 38, 0.05));
}

/* Loading state */
.country-selector.loading {
    opacity: 0.7;
    pointer-events: none;
}

.country-selector.loading::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    .modern-phone-input-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem;
    }

    .country-selector-wrapper {
        min-width: 100%;
    }

    .country-selector {
        min-height: 48px;
        padding: 0.75rem;
    }

    .country-dropdown {
        max-height: 280px;
        top: calc(100% + 0.75rem);
    }

    .country-list {
        max-height: 200px;
    }

    .modern-input {
        padding: 0.75rem 3.5rem 0.75rem 0.875rem;
        font-size: 0.9rem;
    }

    .input-icon {
        right: 2.5rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .modern-phone-input-container {
        padding: 0.5rem;
        gap: 0.75rem;
    }

    .country-selector,
    .modern-input {
        padding: 0.625rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .selected-country .flag {
        font-size: 1.2rem;
    }

    .country-item {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .search-box {
        padding: 0.75rem;
    }

    .search-box input {
        padding: 0.625rem 0.625rem 0.625rem 2.25rem;
        font-size: 0.85rem;
    }

    .country-dropdown {
        max-height: 250px;
    }

    .country-list {
        max-height: 180px;
    }

    .modern-input {
        padding: 0.625rem 3rem 0.625rem 0.75rem;
    }

    .input-icon {
        right: 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .modern-phone-input-container {
        padding: 0.375rem;
        gap: 0.5rem;
    }

    .country-selector,
    .modern-input {
        padding: 0.5rem;
        font-size: 0.8rem;
        min-height: 40px;
    }

    .selected-country .flag {
        font-size: 1.1rem;
    }

    .country-item {
        padding: 0.625rem;
        font-size: 0.8rem;
    }

    .search-box {
        padding: 0.625rem;
    }

    .search-box input {
        padding: 0.5rem 0.5rem 0.5rem 2rem;
        font-size: 0.8rem;
    }

    .country-dropdown {
        max-height: 220px;
    }

    .country-list {
        max-height: 160px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .modern-phone-input-container {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.1), rgba(51, 65, 85, 0.1));
        border-color: rgba(102, 126, 234, 0.2);
    }

    .modern-phone-input-container:focus-within {
        border-color: rgba(102, 126, 234, 0.4);
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.15), rgba(51, 65, 85, 0.15));
    }

    .country-selector,
    .country-dropdown,
    .modern-input {
        background: linear-gradient(135deg, #1e293b, #334155);
        border-color: rgba(102, 126, 234, 0.3);
        color: #f1f5f9;
    }

    .country-selector:hover,
    .country-item:hover {
        background: linear-gradient(135deg, #334155, #475569);
    }

    .search-box {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.1), rgba(51, 65, 85, 0.1));
        border-bottom-color: rgba(102, 126, 234, 0.2);
    }

    .search-box input {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(102, 126, 234, 0.3);
        color: #f1f5f9;
    }

    .country-item .country-name {
        color: #f1f5f9;
    }

    .modern-input::placeholder {
        color: #94a3b8;
    }

    .selected-country {
        color: #f1f5f9;
    }
}

/* Animation enhancements */
@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
    }
}

.country-dropdown.show {
    animation: slideInFromTop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-input:focus {
    animation: pulse 2s infinite;
}

/* Accessibility improvements */
.country-selector:focus,
.modern-input:focus {
    outline: 2px solid rgba(102, 126, 234, 0.6);
    outline-offset: 2px;
}

.country-item:focus {
    outline: 2px solid rgba(102, 126, 234, 0.6);
    outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modern-phone-input-container {
        border-width: 3px;
        border-color: #000;
    }

    .country-selector,
    .modern-input {
        border-width: 3px;
        border-color: #000;
    }

    .country-dropdown {
        border-width: 3px;
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .country-selector,
    .modern-input,
    .country-item,
    .country-dropdown,
    .dropdown-icon,
    .validation-icon {
        transition: none;
        animation: none;
    }

    .country-item::before {
        display: none;
    }
}

/* Additional validation states */
.phone-input-wrapper.valid .modern-input {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.phone-input-wrapper.invalid .modern-input {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.phone-input-wrapper.valid .input-validation {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.phone-input-wrapper.invalid .input-validation .validation-icon {
    color: #ef4444;
}

.phone-input-wrapper.invalid .input-validation .validation-icon::before {
    content: '\f62a';
    /* Bootstrap icon for X */
    font-family: 'bootstrap-icons';
}

/* Loading states */
.modern-phone-input-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.modern-phone-input-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Success animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.phone-input-wrapper.valid .modern-input {
    animation: successPulse 0.6s ease-out;
}

/* Error shake animation */
@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.phone-input-wrapper.invalid .modern-input {
    animation: errorShake 0.5s ease-in-out;
}

/* Focus ring enhancement */
.modern-phone-input-container:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

/* Smooth transitions for all interactive elements */
.country-selector,
.modern-input,
.country-item,
.search-box input {
    will-change: transform, box-shadow, border-color;
}

/* Performance optimization */
.country-list {
    contain: layout style paint;
}

.country-dropdown {
    contain: layout style paint;
}

/* ========================================
   MODERN DROPDOWN COMPONENTS
======================================== */

/* Advanced Positioning Fixes */
.modern-dropdown-wrapper {
    position: relative;
    width: 100%;
    z-index: 1;
}

/* Modern Dropdown Selector */
.modern-dropdown-selector {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 56px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
}

.modern-dropdown-selector:hover:not(.disabled) {
    border-color: #3498db;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
}

.modern-dropdown-selector.active {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15), 0 4px 20px rgba(52, 152, 219, 0.1);
    background: linear-gradient(135deg, #ffffff, #eef2ff);
}

.modern-dropdown-selector.disabled {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.modern-dropdown-selector.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

/* Dropdown Icon */
.dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #7f8c8d;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.modern-dropdown-selector.active .dropdown-icon {
    color: #3498db;
}

.modern-dropdown-selector.error .dropdown-icon {
    color: #e74c3c;
}

/* Dropdown Content */
.dropdown-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    min-width: 0;
}

.dropdown-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
    transition: color 0.3s ease;
}

.dropdown-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3498db;
    margin-top: 2px;
}

.modern-dropdown-selector.disabled .dropdown-text {
    color: #95a5a6;
}

.modern-dropdown-selector.error .dropdown-text {
    color: #e74c3c;
}

/* Dropdown Arrow */
.dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #7f8c8d;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.modern-dropdown-selector.active .dropdown-arrow {
    transform: rotate(180deg);
    color: #3498db;
}

.modern-dropdown-selector.error .dropdown-arrow {
    color: #e74c3c;
}

/* Modern Dropdown Menu */
.modern-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #e1e8ed;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(25px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-height: 400px;
    overflow: hidden;
    will-change: transform, opacity, visibility;
    contain: layout style paint;
    max-width: calc(100vw - 2rem);
}

.modern-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown Search */
.dropdown-search {
    position: relative;
    padding: 12px 16px;
    border-bottom: 1px solid #e1e8ed;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.dropdown-search i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 0.875rem;
    z-index: 1;
}

.dropdown-search .search-input {
    width: 100%;
    padding: 10px 10px 10px 32px;
    border: none;
    border-bottom: 2px solid #fbbf24;
    border-radius: 0;
    font-size: 0.9rem;
    background: transparent;
    transition: all 0.3s ease;
    box-shadow: none;
}

.dropdown-search .search-input:focus {
    outline: none;
    border-bottom-color: #f59e0b;
    box-shadow: none;
}

/* Dropdown List */
.dropdown-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 12px 0;
    scroll-behavior: smooth;
}

.dropdown-list::-webkit-scrollbar {
    width: 8px;
}

.dropdown-list::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
    border-radius: 4px;
    margin: 8px 0;
}

.dropdown-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.dropdown-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Dropdown Item */
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    margin: 0 8px 4px 8px;
    border-radius: 8px;
    background: transparent;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.08), transparent);
    transition: left 0.6s ease;
    border-radius: 12px;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: none;
    box-shadow: none;
}

.dropdown-item:hover::before {
    left: 100%;
}

.dropdown-item.selected {
    background: rgba(59, 130, 246, 0.15);
    color: #1e40af;
    box-shadow: none;
    transform: none;
}

/* Item Icon */
.item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border-radius: 0;
    color: #9ca3af;
    font-size: 0.9rem;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: none;
}

.dropdown-item:hover .item-icon {
    background: transparent;
    color: #3b82f6;
    transform: none;
    box-shadow: none;
}

.dropdown-item.selected .item-icon {
    background: transparent;
    color: #1e40af;
    transform: none;
    box-shadow: none;
}

/* Item Content */
.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.item-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.dropdown-item:hover .item-title {
    color: #3498db;
}

.dropdown-item.selected .item-title {
    color: #1e40af;
    font-weight: 700;
}

/* Item Check */
.item-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #3b82f6;
    font-size: 0.9rem;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: transparent;
    border-radius: 0;
}

.dropdown-item.selected .item-check {
    opacity: 1;
    transform: scale(1);
    background: transparent;
    animation: checkmarkPulse 0.6s ease-out;
}

@keyframes checkmarkPulse {
    0% {
        transform: scale(0.7);
        background: transparent;
    }

    50% {
        transform: scale(1.2);
        background: transparent;
    }

    100% {
        transform: scale(1);
        background: transparent;
    }
}

/* Dropdown Empty State */
.dropdown-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #64748b;
    text-align: center;
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.5), rgba(226, 232, 240, 0.3));
    border-radius: 12px;
    margin: 12px;
}

.dropdown-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.6;
    color: #94a3b8;
}

.dropdown-empty span {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
}

/* Loading State */
.modern-dropdown-selector.loading {
    opacity: 0.7;
    pointer-events: none;
}

.modern-dropdown-selector.loading::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }

    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Responsive Design for Dropdowns */
@media (max-width: 768px) {
    .modern-dropdown-selector {
        min-height: 52px;
    }

    .dropdown-icon,
    .dropdown-arrow {
        width: 44px;
        height: 44px;
    }

    .dropdown-content {
        padding: 12px 14px;
    }

    .dropdown-text {
        font-size: 0.9rem;
    }

    .modern-dropdown-menu {
        max-height: 350px;
        top: calc(100% + 8px);
        border-radius: 14px;
        position: fixed;
        left: 0 !important;
        right: 0 !important;
        max-width: calc(100vw - 1rem);
        margin: 0 0.5rem;
    }

    .dropdown-list {
        max-height: 250px;
        padding: 8px 0;
    }

    .dropdown-item {
        padding: 14px 16px;
        margin: 0 8px 6px 8px;
        border-radius: 10px;
    }

    .item-icon {
        width: 36px;
        height: 36px;
        margin-right: 12px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .item-title {
        font-size: 0.9rem;
    }

    .item-subtitle {
        font-size: 0.75rem;
    }

    .item-check {
        width: 22px;
        height: 22px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .modern-dropdown-selector {
        min-height: 48px;
    }

    .dropdown-icon,
    .dropdown-arrow {
        width: 40px;
        height: 40px;
    }

    .dropdown-content {
        padding: 10px 12px;
    }

    .dropdown-text {
        font-size: 0.85rem;
    }

    .modern-dropdown-menu {
        max-height: 300px;
        top: calc(100% + 6px);
        border-radius: 12px;
    }

    .dropdown-list {
        max-height: 220px;
        padding: 6px 0;
    }

    .dropdown-item {
        padding: 12px 14px;
        margin: 0 6px 4px 6px;
        border-radius: 8px;
    }

    .item-icon {
        width: 32px;
        height: 32px;
        margin-right: 10px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .item-title {
        font-size: 0.85rem;
    }

    .item-subtitle {
        font-size: 0.7rem;
    }

    .item-check {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }

    .dropdown-empty {
        padding: 32px 16px;
        margin: 8px;
        border-radius: 10px;
    }

    .dropdown-empty i {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .dropdown-empty span {
        font-size: 0.85rem;
    }
}

/* Additional Performance Optimizations */
.modern-dropdown-menu {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.dropdown-item {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* Smooth entrance animations */
@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes itemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.modern-dropdown-menu.show {
    animation: dropdownSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dropdown-item {
    animation: itemSlideIn 0.3s ease-out;
    animation-fill-mode: both;
}

.dropdown-item:nth-child(1) {
    animation-delay: 0.05s;
}

.dropdown-item:nth-child(2) {
    animation-delay: 0.1s;
}

.dropdown-item:nth-child(3) {
    animation-delay: 0.15s;
}

.dropdown-item:nth-child(4) {
    animation-delay: 0.2s;
}

.dropdown-item:nth-child(5) {
    animation-delay: 0.25s;
}

.dropdown-item:nth-child(6) {
    animation-delay: 0.3s;
}

.dropdown-item:nth-child(7) {
    animation-delay: 0.35s;
}

.dropdown-item:nth-child(8) {
    animation-delay: 0.4s;
}

.dropdown-item:nth-child(9) {
    animation-delay: 0.45s;
}

.dropdown-item:nth-child(10) {
    animation-delay: 0.5s;
}

/* Focus improvements */
.modern-dropdown-selector:focus {
    outline: 2px solid rgba(52, 152, 219, 0.6);
    outline-offset: 2px;
}

.dropdown-item:focus {
    outline: 2px solid rgba(52, 152, 219, 0.6);
    outline-offset: -2px;
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .modern-dropdown-menu {
        border-width: 3px;
        border-color: #000;
    }

    .dropdown-item {
        border: 1px solid transparent;
    }

    .dropdown-item:hover {
        border-color: #000;
    }

    .dropdown-item.selected {
        border-color: #000;
        background: #f0f0f0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modern-dropdown-selector {
        background: linear-gradient(135deg, #1e293b, #334155);
        border-color: #475569;
        color: #f1f5f9;
    }

    .modern-dropdown-selector:hover:not(.disabled) {
        background: linear-gradient(135deg, #334155, #475569);
        border-color: #3498db;
    }

    .modern-dropdown-selector.active {
        background: linear-gradient(135deg, #334155, #475569);
        border-color: #3498db;
    }

    .modern-dropdown-selector.disabled {
        background: linear-gradient(135deg, #374151, #4b5563);
        border-color: #6b7280;
    }

    .dropdown-icon,
    .dropdown-arrow {
        color: #94a3b8;
    }

    .dropdown-text {
        color: #f1f5f9;
    }

    .dropdown-value {
        color: #3498db;
    }

    .modern-dropdown-menu {
        background: rgba(30, 41, 59, 0.98);
        border-color: #475569;
    }

    .dropdown-search {
        background: linear-gradient(135deg, #374151, #4b5563);
        border-bottom-color: #6b7280;
    }

    .dropdown-search .search-input {
        background: transparent;
        border-bottom-color: #fbbf24;
        color: #f1f5f9;
    }

    .dropdown-search .search-input:focus {
        border-bottom-color: #f59e0b;
    }

    .dropdown-item:hover {
        background: rgba(59, 130, 246, 0.1);
    }

    .dropdown-item.selected {
        background: rgba(59, 130, 246, 0.15);
    }

    .item-icon {
        background: transparent;
        color: #9ca3af;
    }

    .dropdown-item:hover .item-icon {
        background: transparent;
        color: #3b82f6;
    }

    .item-title {
        color: #f1f5f9;
    }

    .item-subtitle {
        color: #9ca3af;
    }

    .dropdown-empty {
        color: #94a3b8;
    }
}

/* ========================================
   MODERN TOGGLE SWITCHES
======================================== */
.modern-toggle-section {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.02), rgba(25, 135, 84, 0.02));
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid rgba(13, 110, 253, 0.1);
    position: relative;
    overflow: hidden;
}

.modern-toggle-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #0d6efd, #198754, #fd7e14);
    opacity: 0.6;
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 1.5rem !important;
    color: #0d6efd !important;
    font-weight: 600 !important;
    position: relative;
}

.section-title i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    color: #198754;
}

.modern-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid rgba(13, 110, 253, 0.08);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modern-toggle-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.05), transparent);
    transition: left 0.6s ease;
}

.modern-toggle-item:hover {
    border-color: rgba(13, 110, 253, 0.2);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.1);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
}

.modern-toggle-item:hover::before {
    left: 100%;
}

.modern-toggle-item:last-child {
    margin-bottom: 0;
}

.toggle-content {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 1rem;
}

.toggle-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0d6efd, #198754);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.modern-toggle-item:hover .toggle-icon {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.toggle-info {
    flex: 1;
    min-width: 0;
}

.toggle-title {
    font-size: 1rem;
    font-weight: 600 !important;
    color: #1e293b;
    margin-bottom: 0.25rem !important;
    line-height: 1.4;
}

.toggle-description {
    font-size: 0.875rem;
    color: #64748b !important;
    margin-bottom: 0 !important;
    line-height: 1.4;
}

.toggle-switch {
    position: relative;
    flex-shrink: 0;
}

.modern-switch {
    display: none;
}

.switch-label {
    position: relative;
    display: block;
    width: 60px;
    height: 32px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(13, 110, 253, 0.1);
}

.switch-label:hover {
    border-color: rgba(13, 110, 253, 0.3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.switch-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.1);
}

.modern-switch:checked+.switch-label {
    background: linear-gradient(135deg, #0d6efd, #198754);
    border-color: rgba(13, 110, 253, 0.3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(13, 110, 253, 0.15);
}

.modern-switch:checked+.switch-label .switch-slider {
    transform: translateX(28px);
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: rgba(13, 110, 253, 0.2);
}

.modern-switch:checked+.switch-label:hover {
    border-color: rgba(13, 110, 253, 0.5);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 6px rgba(13, 110, 253, 0.2);
}

.modern-switch:focus+.switch-label {
    outline: 2px solid rgba(13, 110, 253, 0.6);
    outline-offset: 2px;
}

/* Active state animation */
.modern-switch:checked+.switch-label .switch-slider::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0d6efd;
    font-size: 0.7rem;
    font-weight: bold;
    opacity: 0;
    animation: checkmark 0.3s ease 0.1s forwards;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Pulse animation for active toggles */
.modern-switch:checked+.switch-label {
    animation: togglePulse 0.6s ease-out;
}

@keyframes togglePulse {
    0% {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(13, 110, 253, 0.15);
    }

    50% {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 8px rgba(13, 110, 253, 0.1);
    }

    100% {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(13, 110, 253, 0.15);
    }
}

/* Responsive design for toggle switches */
@media (max-width: 768px) {
    .modern-toggle-section {
        padding: 1.25rem;
        margin: 1.25rem 0;
    }

    .modern-toggle-item {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .toggle-content {
        width: 100%;
        justify-content: space-between;
    }

    .toggle-switch {
        align-self: flex-end;
    }

    .toggle-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .toggle-title {
        font-size: 0.95rem;
    }

    .toggle-description {
        font-size: 0.8rem;
    }

    .switch-label {
        width: 56px;
        height: 30px;
    }

    .switch-slider {
        width: 22px;
        height: 22px;
    }

    .modern-switch:checked+.switch-label .switch-slider {
        transform: translateX(26px);
    }
}

@media (max-width: 576px) {
    .modern-toggle-section {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 12px;
    }

    .modern-toggle-item {
        padding: 0.875rem;
        border-radius: 10px;
    }

    .toggle-content {
        gap: 0.75rem;
    }

    .toggle-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 10px;
    }

    .toggle-title {
        font-size: 0.9rem;
    }

    .toggle-description {
        font-size: 0.75rem;
    }

    .switch-label {
        width: 52px;
        height: 28px;
    }

    .switch-slider {
        width: 20px;
        height: 20px;
    }

    .modern-switch:checked+.switch-label .switch-slider {
        transform: translateX(24px);
    }
}

@media (max-width: 480px) {
    .modern-toggle-section {
        padding: 0.875rem;
        margin: 0.875rem 0;
    }

    .modern-toggle-item {
        padding: 0.75rem;
    }

    .toggle-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .toggle-title {
        font-size: 0.85rem;
    }

    .toggle-description {
        font-size: 0.7rem;
    }

    .switch-label {
        width: 48px;
        height: 26px;
    }

    .switch-slider {
        width: 18px;
        height: 18px;
    }

    .modern-switch:checked+.switch-label .switch-slider {
        transform: translateX(22px);
    }
}

/* Dark mode support for toggle switches */
@media (prefers-color-scheme: dark) {
    .modern-toggle-section {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.1), rgba(51, 65, 85, 0.1));
        border-color: rgba(13, 110, 253, 0.2);
    }

    .modern-toggle-item {
        background: linear-gradient(135deg, #1e293b, #334155);
        border-color: rgba(13, 110, 253, 0.15);
    }

    .modern-toggle-item:hover {
        background: linear-gradient(135deg, #334155, #475569);
        border-color: rgba(13, 110, 253, 0.3);
    }

    .toggle-title {
        color: #f1f5f9;
    }

    .toggle-description {
        color: #94a3b8 !important;
    }

    .switch-label {
        background: linear-gradient(135deg, #374151, #4b5563);
        border-color: rgba(13, 110, 253, 0.2);
    }

    .switch-slider {
        background: linear-gradient(135deg, #f8fafc, #e2e8f0);
        border-color: rgba(13, 110, 253, 0.2);
    }

    .modern-switch:checked+.switch-label {
        background: linear-gradient(135deg, #0d6efd, #198754);
        border-color: rgba(13, 110, 253, 0.4);
    }

    .modern-switch:checked+.switch-label .switch-slider {
        background: linear-gradient(135deg, #ffffff, #f0f9ff);
        border-color: rgba(13, 110, 253, 0.3);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modern-toggle-section {
        border-width: 3px;
        border-color: #000;
    }

    .modern-toggle-item {
        border-width: 3px;
        border-color: #000;
    }

    .switch-label {
        border-width: 3px;
        border-color: #000;
    }

    .modern-switch:checked+.switch-label {
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .modern-toggle-item,
    .toggle-icon,
    .switch-label,
    .switch-slider,
    .modern-switch:checked+.switch-label .switch-slider::after {
        transition: none;
        animation: none;
    }

    .modern-toggle-item::before {
        display: none;
    }
}

/* ========================================
   MODERN RESULT LIST STYLES
======================================== */

/* Modern Result Container */
.modern-result-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid rgba(13, 110, 253, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.modern-result-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0d6efd, #198754, #fd7e14, #dc3545);
    opacity: 0.8;
}

/* Result Header */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(13, 110, 253, 0.1);
}

.result-title {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0d6efd;
    margin: 0;
}

.result-title i {
    font-size: 1.4rem;
    margin-right: 0.75rem;
    color: #198754;
    filter: drop-shadow(0 2px 4px rgba(25, 135, 132, 0.3));
}

.result-count {
    background: linear-gradient(135deg, #0d6efd, #198754);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
    }
}

/* Modern Result Grid */
.modern-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Modern Result Card */
.modern-result-card {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid rgba(13, 110, 253, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modern-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.05), transparent);
    transition: left 0.6s ease;
}

.modern-result-card:hover {
    border-color: rgba(13, 110, 253, 0.2);
    box-shadow: 0 8px 32px rgba(13, 110, 253, 0.12);
    transform: translateY(-4px);
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
}

.modern-result-card:hover::before {
    left: 100%;
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0d6efd, #198754);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.modern-result-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 24px rgba(13, 110, 253, 0.4);
}

.card-title {
    flex: 1;
    min-width: 0;
}

.card-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Card Content */
.card-content {
    margin-bottom: 1rem;
}

.card-description {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid rgba(13, 110, 253, 0.1);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
}

.card-meta i {
    font-size: 0.9rem;
    color: #0d6efd;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.card-action-btn:hover {
    background: linear-gradient(135deg, #0d6efd, #198754);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Empty State */
.result-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: #64748b;
}

.result-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: #0d6efd;
}

.result-empty h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.result-empty p {
    font-size: 0.9rem;
    margin: 0;
    max-width: 400px;
}

/* Loading State */
.result-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

.loading-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Responsive Design for Result Lists */
@media (max-width: 1200px) {
    .modern-result-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .modern-result-container {
        padding: 1.25rem;
        margin: 1.25rem 0;
        border-radius: 12px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .result-title {
        font-size: 1.1rem;
    }

    .result-title i {
        font-size: 1.2rem;
        margin-right: 0.5rem;
    }

    .result-count {
        padding: 0.375rem 0.875rem;
        font-size: 0.8rem;
    }

    .modern-result-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modern-result-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .card-header {
        gap: 0.875rem;
    }

    .card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        border-radius: 12px;
    }

    .card-title h3 {
        font-size: 1rem;
    }

    .card-subtitle {
        font-size: 0.75rem;
    }

    .card-description {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .card-footer {
        padding-top: 0.875rem;
    }

    .card-action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .modern-result-container {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 10px;
    }

    .result-header {
        margin-bottom: 1rem;
    }

    .result-title {
        font-size: 1rem;
    }

    .result-title i {
        font-size: 1.1rem;
    }

    .modern-result-card {
        padding: 1rem;
        border-radius: 10px;
    }

    .card-header {
        gap: 0.75rem;
    }

    .card-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        border-radius: 10px;
    }

    .card-title h3 {
        font-size: 0.95rem;
    }

    .card-subtitle {
        font-size: 0.7rem;
    }

    .card-description {
        font-size: 0.8rem;
    }

    .card-footer {
        padding-top: 0.75rem;
    }

    .card-action-btn {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .result-empty {
        padding: 2rem 1rem;
    }

    .result-empty i {
        font-size: 3rem;
    }

    .result-empty h3 {
        font-size: 1.1rem;
    }

    .result-empty p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .modern-result-container {
        padding: 0.875rem;
        margin: 0.875rem 0;
    }

    .modern-result-card {
        padding: 0.875rem;
    }

    .card-header {
        gap: 0.625rem;
    }

    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 8px;
    }

    .card-title h3 {
        font-size: 0.9rem;
    }

    .card-subtitle {
        font-size: 0.65rem;
    }

    .card-description {
        font-size: 0.75rem;
    }

    .card-action-btn {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

/* Dark Mode Support for Result Lists */
@media (prefers-color-scheme: dark) {
    .modern-result-container {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(51, 65, 85, 0.95));
        border-color: rgba(13, 110, 253, 0.2);
    }

    .result-title {
        color: #60a5fa;
    }

    .result-title i {
        color: #34d399;
    }

    .modern-result-card {
        background: linear-gradient(135deg, #1e293b, #334155);
        border-color: rgba(13, 110, 253, 0.15);
    }

    .modern-result-card:hover {
        background: linear-gradient(135deg, #334155, #475569);
        border-color: rgba(13, 110, 253, 0.3);
    }

    .card-title h3 {
        color: #f1f5f9;
    }

    .card-subtitle {
        color: #94a3b8;
    }

    .card-description {
        color: #cbd5e1;
    }

    .card-meta {
        color: #94a3b8;
    }

    .card-meta i {
        color: #60a5fa;
    }

    .card-action-btn {
        background: linear-gradient(135deg, #374151, #4b5563);
        color: #94a3b8;
    }

    .card-action-btn:hover {
        background: linear-gradient(135deg, #0d6efd, #198754);
        color: white;
    }

    .result-empty {
        color: #94a3b8;
    }

    .result-empty h3 {
        color: #f1f5f9;
    }

    .result-empty i {
        color: #60a5fa;
    }

    .result-loading {
        color: #94a3b8;
    }

    .loading-spinner {
        border-color: #374151;
        border-top-color: #60a5fa;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .modern-result-container {
        border-width: 3px;
        border-color: #000;
    }

    .modern-result-card {
        border-width: 3px;
        border-color: #000;
    }

    .card-action-btn {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .modern-result-card,
    .card-icon,
    .card-action-btn,
    .result-count {
        transition: none;
        animation: none;
    }

    .modern-result-card::before {
        display: none;
    }
}

/* Print styles */
@media print {
    .modern-phone-input-container {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .country-dropdown {
        display: none !important;
    }

    .input-icon,
    .validation-icon {
        display: none !important;
    }

    .modern-toggle-section {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .modern-toggle-item {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .toggle-icon {
        background: #f0f0f0 !important;
        color: #000 !important;
    }

    .switch-label {
        background: #f0f0f0 !important;
        border: 1px solid #000 !important;
    }

    .switch-slider {
        background: white !important;
        border: 1px solid #000 !important;
    }

    .modern-result-container {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .modern-result-card {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .card-icon {
        background: #f0f0f0 !important;
        color: #000 !important;
    }

    .card-action-btn {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
}
