/* ============================================
   UI CONSISTENCY STANDARDS - ALL COMPONENTS
   Master file for unified modal widths, buttons, toasts, and UI elements
   Reference: Offerings Modal (PERFECT STANDARD)
   ============================================ */

/* ============================================
   MODAL WIDTH SYSTEM (ONE STANDARD)
   ============================================ */

/* Default modal - All modals use this base */
.modal,
.modal-premium {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2rem 1rem;
    box-sizing: border-box;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .modal,
    .modal-premium {
        padding: 2rem;
    }
}

.modal.hidden,
.modal-premium.hidden {
    display: none !important;
}

/* Modal backdrop - consistent across all */
.modal-overlay,
.modal-premium::before {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9998;
    pointer-events: auto;
    cursor: pointer;
}

/* ============================================
   SIMPLIFIED MODAL STYLING - CLEAN APPROACH
   ============================================ */

/* Base: All modal containers */
.modal-container,
.modal-card-premium {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    animation: modalSlideUp 0.3s ease-out;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    /* Mobile-first: 90vw with safe padding */
    width: calc(100vw - 32px) !important;
    max-width: 90vw !important;
}

/* Tablet: 95% width (641px - 1023px) */
@media (min-width: 641px) and (max-width: 1023px) {
    .modal-container,
    .modal-card-premium {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 75vh !important; /* Reduced to avoid navbar overlap */
        top: 45% !important; /* Shift up slightly */
    }

    .modal .modal-container {
        top: 45% !important;
    }
}

/* Desktop: Fixed widths by size class (1024px+) */
@media (min-width: 1024px) {
    /* Default/Medium: 800px */
    .modal-container,
    .modal-card-premium {
        width: 800px !important;
        max-width: 800px !important;
    }

    /* Small: 600px */
    .modal.modal-sm .modal-container,
    .modal-sm .modal-container {
        width: 600px !important;
        max-width: 600px !important;
    }

    /* Large: 1000px - For complex forms that need extra width */
    .modal.modal-lg .modal-container,
    .modal-lg .modal-container {
        width: 1000px !important;
        max-width: 1000px !important;
    }

    /* Extra Large: 1200px */
    .modal.modal-xl .modal-container,
    .modal-xl .modal-container {
        width: 1200px !important;
        max-width: 1200px !important;
    }
}

/* Modal header - unified */
.modal-header,
.modal-header-premium {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-title,
.modal-header-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Modal close button - UNIFIED STYLE */
.modal-close,
.modal-close-btn-premium,
.modal-close-button {
    background: none;
    border: 1px solid var(--border-light);
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 0.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    flex-shrink: 0;
}

.modal-close:hover,
.modal-close-btn-premium:hover,
.modal-close-button:hover {
    color: var(--text-dark);
    background-color: var(--bg-light);
    border-color: var(--border-medium);
}

.modal-close-button i {
    font-size: 1.5rem;
    line-height: 1;
}

/* Modal body - unified */
.modal-body,
.modal-body-premium {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Modal footer - unified */
.modal-footer,
.modal-footer-premium {
    padding: 1.5rem;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ============================================
   BUTTON SYSTEM (UNIFIED ACROSS ALL COMPONENTS)
   ============================================ */

/* Base button style */
.modal-btn,
.btn-primary-premium,
.btn-secondary-premium,
.btn-danger-premium,
.holded-button,
.holded-button-primary,
.holded-button-secondary,
.holded-button-danger {
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-lg, 0.75rem);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    min-height: 44px;
}

/* PRIMARY BUTTON - Orange/Yellow Brand Color */
.modal-btn-primary,
.btn-primary-premium,
.holded-button-primary,
.btn-primary-premium {
    background: linear-gradient(135deg, #FFA94D 0%, #FFA94D 100%);
    color: var(--text-dark, #1a1a1a);
    box-shadow: 0 4px 12px rgba(255, 169, 77, 0.3);
}

.modal-btn-primary:hover,
.btn-primary-premium:hover,
.holded-button-primary:hover,
.btn-primary-premium:hover {
    box-shadow: 0 6px 16px rgba(255, 169, 77, 0.4);
    transform: translateY(-2px);
}

.modal-btn-primary:active,
.btn-primary-premium:active,
.holded-button-primary:active,
.btn-primary-premium:active {
    transform: translateY(0);
}

/* SECONDARY BUTTON - White with border */
.modal-btn-secondary,
.btn-secondary-premium,
.holded-button-secondary,
.btn-secondary-premium {
    background: white;
    color: var(--text-dark, #1a1a1a);
    border: 1px solid var(--border-light, #e5e5e5);
}

.modal-btn-secondary:hover,
.btn-secondary-premium:hover,
.holded-button-secondary:hover,
.btn-secondary-premium:hover {
    background: var(--bg-light, #f5f5f5);
    border-color: var(--border-medium, #d0d0d0);
}

.modal-btn-secondary:active,
.btn-secondary-premium:active,
.holded-button-secondary:active,
.btn-secondary-premium:active {
    background: #f0f0f0;
}

/* DANGER BUTTON - Red */
.modal-btn-danger,
.btn-danger-premium,
.holded-button-danger {
    background: #fee2e2;
    color: #dc2626;
    border: none;
}

.modal-btn-danger:hover,
.btn-danger-premium:hover,
.holded-button-danger:hover {
    background: #fecaca;
}

.modal-btn-danger:active,
.btn-danger-premium:active,
.holded-button-danger:active {
    background: #fca5a5;
}

/* Button disabled state */
.modal-btn:disabled,
.btn-primary-premium:disabled,
.btn-secondary-premium:disabled,
.btn-danger-premium:disabled,
.holded-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   BUTTON NAMING ALIASES FOR CONSISTENCY
   (Backward compatibility with legacy names)
   ============================================ */

/* Primary button aliases */
.btn-primary-premium,
.modal-btn-primary,
.holded-button-primary {
    background: linear-gradient(135deg, #FFA94D 0%, #FFA94D 100%);
    color: var(--text-dark, #1a1a1a);
    box-shadow: 0 4px 12px rgba(255, 169, 77, 0.3);
}

.btn-primary-premium:hover,
.modal-btn-primary:hover,
.holded-button-primary:hover {
    box-shadow: 0 6px 16px rgba(255, 169, 77, 0.4);
    transform: translateY(-2px);
}

/* Secondary button aliases */
.btn-secondary-premium,
.modal-btn-secondary,
.holded-button-secondary {
    background: white;
    color: var(--text-dark, #1a1a1a);
    border: 1px solid var(--border-light, #e5e5e5);
}

.btn-secondary-premium:hover,
.modal-btn-secondary:hover,
.holded-button-secondary:hover {
    background: var(--bg-light, #f5f5f5);
    border-color: var(--border-medium, #d0d0d0);
}

/* Danger button aliases */
.btn-danger-premium,
.modal-btn-danger,
.holded-button-danger {
    background: #fee2e2;
    color: #dc2626;
    border: none;
}

.btn-danger-premium:hover,
.modal-btn-danger:hover,
.holded-button-danger:hover {
    background: #fecaca;
}

/* ============================================
   TOAST / NOTIFICATION STYLES (UNIFIED)
   ============================================ */

/* Base toast container */
.toast,
.notification,
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg, 0.75rem);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    animation: slideInUp 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Toast variants */
.toast-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.toast-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.toast-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.toast-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Toast icon */
.toast i,
.notification i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Toast close button */
.toast-close,
.notification-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    margin-left: auto;
    padding: 0;
    font-size: 1.25rem;
    transition: opacity 0.2s ease;
}

.toast-close:hover,
.notification-close:hover {
    opacity: 0.7;
}

/* ============================================
   FORM INPUTS - UNIFIED STYLE
   ============================================ */

.modal-form-input,
.modal-form-select,
.modal-form-textarea,
.holded-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-light, #e5e5e5);
    border-radius: var(--radius-lg, 0.75rem);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-dark);
}

.modal-form-input:focus,
.modal-form-select:focus,
.modal-form-textarea:focus,
.holded-input:focus {
    outline: none;
    border-color: #FFA94D;
    box-shadow: 0 0 0 3px rgba(255, 169, 77, 0.1);
}

.modal-form-textarea,
.holded-input.textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form label */
.modal-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.modal-form-label.required::after {
    content: ' *';
    color: #dc2626;
}

/* Form hint */
.modal-form-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.4rem;
}

/* ============================================
   INFO BOXES - UNIFIED STYLE
   ============================================ */

.modal-info-box,
.generic-info-box {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
    border-left: 4px solid;
}

.modal-info-box.info,
.modal-info-box,
.generic-info-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
    border-left-color: #3b82f6;
}

.modal-info-box.info i,
.generic-info-box i {
    color: #3b82f6;
    font-weight: 600;
}

.modal-info-box.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
    border-left-color: #10b981;
}

.modal-info-box.success i {
    color: #10b981;
}

.modal-info-box.warning,
.generic-info-box.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
    border-left-color: #f59e0b;
}

.modal-info-box.warning i,
.generic-info-box.warning i {
    color: #f59e0b;
}

.modal-info-box.error {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08) 0%, rgba(220, 38, 38, 0.04) 100%);
    border-left-color: #dc2626;
}

.modal-info-box.error i {
    color: #dc2626;
}

.modal-info-box .content,
.generic-info-box-text {
    font-size: 0.875rem;
    margin: 0;
    font-weight: 500;
}

/* ============================================
   CHECKBOX & RADIO - UNIFIED STYLE
   ============================================ */

.generic-checkbox-custom,
.generic-radio-item,
.shop-size-checkbox-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-medium);
    user-select: none;
    background: #f9f9f9;
}

.generic-checkbox-custom:hover,
.generic-radio-item:hover,
.shop-size-checkbox-custom:hover {
    border-color: #FFA94D;
    background: rgba(255, 169, 77, 0.05);
}

.generic-checkbox-custom input,
.generic-radio-item input,
.shop-size-checkbox-custom input {
    display: none;
}

.generic-checkbox-custom:has(input:checked),
.generic-radio-item:has(input:checked),
.shop-size-checkbox-custom:has(input:checked) {
    background: #FFA94D;
    border-color: #FFA94D;
    color: white;
}

/* ============================================
   MODAL ANIMATIONS - UNIFIED
   ============================================ */

@keyframes modalSlideUp {
    from {
        transform: translate(-50%, calc(-50% + 30px));
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.5;
    }
}

.modal .modal-container,
.modal-card-premium {
    animation: modalSlideUp 0.3s ease-out;
}

.modal-overlay,
.modal-premium::before {
    animation: backdropFadeIn 0.3s ease-out;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .modal-container,
    .modal-card-premium {
        width: 95vw !important;
        max-width: 95vw !important;
    }

    .modal-header,
    .modal-header-premium {
        padding: 1.25rem;
    }

    .modal-body,
    .modal-body-premium {
        padding: 1.25rem;
    }

    .modal-footer,
    .modal-footer-premium {
        padding: 1.25rem;
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .modal-container,
    .modal-card-premium {
        width: 100%;
        max-width: 100%;
        border-radius: 1.5rem 1.5rem 0 0;
        max-height: 95vh;
    }

    .modal-footer,
    .modal-footer-premium {
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   UNIVERSAL ICON BADGE
   ============================================ */

.modal-icon-badge,
.icon-badge {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #FFA94D 0%, #FFA94D 100%);
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(255, 169, 77, 0.3);
}

/* ============================================
   SECTION HEADERS - UNIFIED
   ============================================ */

.section-header-primary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.section-header-title h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.5rem;
    letter-spacing: -0.5px;
}

.section-header-title p {
    font-size: 1rem;
    color: var(--text-medium);
    margin: 0;
}

.section-header-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   FILTER TOOLBAR - UNIFIED
   ============================================ */

.filter-toolbar {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-toolbar.hidden {
    display: none !important;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 160px;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
    padding: 0.65rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    background: white;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #FFA94D;
    box-shadow: 0 0 0 3px rgba(255, 169, 77, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.filter-btn-apply {
    background: linear-gradient(135deg, #FFA94D 0%, #FFA94D 100%);
    color: var(--text-dark);
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn-apply:hover {
    transform: translateY(-1px);
}

.filter-btn-reset {
    background: #f5f5f5;
    color: #666;
    padding: 0.65rem 1.25rem;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
}

.filter-btn-reset:hover {
    background: #f0f0f0;
}

/* ============================================
   EMPTY STATE - UNIFIED
   ============================================ */

.empty-state-premium,
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #666;
}

.empty-state-icon,
.icon-empty {
    font-size: 3.5rem;
    background: linear-gradient(135deg, rgba(255, 169, 77, 0.1) 0%, rgba(255, 169, 77, 0.1) 100%);
    color: #FFA94D;
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: #999;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.empty-state-action {
    background: linear-gradient(135deg, #FFA94D 0%, #FFA94D 100%);
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.empty-state-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 169, 77, 0.3);
}
