/* ============================================
   CUSTOMER INFO POPUP - HAKIMI THEME
   Based on login-popup.css design system
   ============================================ */

/* Body state when popup is open */
body.customer-info-popup-open {
    overflow: hidden;
}

/* ========================================
   POPUP OVERLAY - Main Container
   ======================================== */
#customer-info-popup-overlay {
    position: fixed !important;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999999 !important;
    display: none;
    align-items: flex-end;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    pointer-events: none;
}

#customer-info-popup-overlay.active {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
}

#customer-info-popup-overlay.closing {
    opacity: 0;
}

/* ========================================
   ALL POPUP CONTENT - Scoped Styles
   ======================================== */

/* Container */
#customer-info-popup-overlay .login-popup-container {
    position: relative;
    background: white;
    width: 100%;
    max-width: 100%;
    max-height: 90%;
    overflow-y: auto;
    border-radius: 12px 12px 0 0;
    padding: 24px;
    padding-bottom: 32px;
    animation: slideUp 0.5s ease-out;
    transition: transform 0.3s ease-in-out;
    z-index: 1000000 !important;
}

#customer-info-popup-overlay.closing .login-popup-container {
    animation: slideDown 0.3s ease-in-out;
}

/* Close Button */
#customer-info-popup-overlay .login-popup-close {
    position: absolute;
    right: 4px;
    top: 4px;
    z-index: 1000001 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #111;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

#customer-info-popup-overlay .login-popup-close:hover {
    background: #1f2937;
}

#customer-info-popup-overlay .login-popup-close:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

#customer-info-popup-overlay .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Content */
#customer-info-popup-overlay .login-popup-content {
    color: #1f2937;
}

#customer-info-popup-overlay .login-popup-logo {
    margin-bottom: 16px;
}

#customer-info-popup-overlay .login-popup-logo img {
    height: auto;
    max-width: 100%;
}

#customer-info-popup-overlay .login-popup-title {
    margin-top: 16px;
    margin-bottom: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.3;
    color: #111;
}

/* Alert Success - Gradient Notification */
#customer-info-popup-overlay .alert-success {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#customer-info-popup-overlay .alert-success > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

#customer-info-popup-overlay .alert-success .icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#customer-info-popup-overlay .alert-success .content-wrapper {
    flex: 1;
    color: white;
}

#customer-info-popup-overlay .alert-success .main-text {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

#customer-info-popup-overlay .alert-success strong {
    color: #FFD700;
}

#customer-info-popup-overlay .alert-success .sub-text {
    font-size: 13px;
    opacity: 0.9;
}

#customer-info-popup-overlay .alert-success .note-text {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

#customer-info-popup-overlay .login-popup-subtitle {
    margin-top: 14px;
    margin-bottom: 0;
    font-size: 12px;
    color: #1f2937;
}

#customer-info-popup-overlay .login-popup-subtitle b {
    font-weight: 600;
}

/* Benefits */
#customer-info-popup-overlay .login-popup-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0;
}

#customer-info-popup-overlay .benefit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#customer-info-popup-overlay .benefit-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

#customer-info-popup-overlay .benefit-text {
    flex: 1;
}

#customer-info-popup-overlay .benefit-text p {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    color: #111;
    margin: 0;
}

/* Form */
#customer-info-popup-overlay .login-popup-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#customer-info-popup-overlay .form-group-popup {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#customer-info-popup-overlay .form-row-popup {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

#customer-info-popup-overlay .input-wrapper {
    position: relative;
    margin-top: 10px;
}

#customer-info-popup-overlay .form-input-popup {
    width: 100%;
    height: 45px;
    padding: 12px 24px;
    border: 1px solid #d1d5db;
    border-radius: 0;
    font-size: 16px;
    color: #1f2937;
    background: white;
    transition: border-color 0.2s;
    outline: none;
}

#customer-info-popup-overlay .form-input-popup::placeholder {
    color: transparent;
}

#customer-info-popup-overlay .form-input-popup:focus {
    border-color: #6b7280;
}

#customer-info-popup-overlay .form-input-popup:hover:not(:disabled) {
    border-color: #6b7280;
}

#customer-info-popup-overlay .form-input-popup:disabled {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #d1d5db;
    cursor: not-allowed;
}

#customer-info-popup-overlay .form-input-popup.error {
    border-color: #dc2626;
}

/* Floating Label - Updated to match mhakimi style */
#customer-info-popup-overlay .form-label-popup {
    position: absolute;
    left: 24px;
    top: 4px;
    color: #6b7280;
    font-size: 16px;
    font-weight: 400;
    background: white;
    padding: 0 8px;
    transform: translateY(-16px) scale(0.8);
    transform-origin: left;
    transition: all 0.3s;
    pointer-events: none;
    line-height: 1;
}

#customer-info-popup-overlay .form-input-popup:placeholder-shown+.form-label-popup {
    position: absolute;
    left: 24px;
    top: 7px;
    color: #6b7280;
    font-size: 16px;
    font-weight: 400;
    background: white;
    padding: 0 8px;
    transform: translateY(-16px) scale(0.8);
    transform-origin: left;
    transition: all 0.3s;
    pointer-events: none;
    line-height: 1;
}

#customer-info-popup-overlay .form-input-popup:focus+.form-label-popup {
    top: 4px;
    transform: translateY(-16px) scale(0.8);
    color: #6b7280;
    padding: 0 8px;
}

/* Select dropdown */
#customer-info-popup-overlay select.form-input-popup {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Small note text under input */
#customer-info-popup-overlay .form-group-popup small {
    margin-left: 10px;
    color: #28a745;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

#customer-info-popup-overlay .form-group-popup small svg {
    vertical-align: middle;
    margin-right: 4px;
}

/* Error Message */
#customer-info-popup-overlay .error-message {
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
    display: none;
}

#customer-info-popup-overlay .error-message.active {
    display: block;
}

/* Submit Button - Updated to match mhakimi style */
#customer-info-popup-overlay .btn-submit-popup {
    font-family: SVN-Gilroy, sans-serif;
    width: 100%;
    height: 37px;
    padding: 8px 24px;
    border: none;
    border-radius: 9999px;
    background: #111;
    color: white;
    font-size: 14px;
    line-height: 24px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 8px;
}

#customer-info-popup-overlay .btn-submit-popup:hover {
    background: #1f2937;
}

#customer-info-popup-overlay .btn-submit-popup:active {
    background: #374151;
}

#customer-info-popup-overlay .btn-submit-popup:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Loading state for button */
#customer-info-popup-overlay .btn-submit-popup.loading {
    position: relative;
    color: transparent;
}

#customer-info-popup-overlay .btn-submit-popup.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(100%);
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

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

@keyframes zoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.95);
        opacity: 0;
    }
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 640px) {
    #customer-info-popup-overlay .login-popup-container {
        padding: 20px;
        padding-bottom: 28px;
    }

    #customer-info-popup-overlay .login-popup-title {
        font-size: 20px;
    }

    #customer-info-popup-overlay .benefit-item {
        padding: 6px;
        gap: 6px;
    }

    #customer-info-popup-overlay .benefit-item svg {
        width: 20px;
        height: 20px;
    }

    #customer-info-popup-overlay .benefit-text p {
        font-size: 11px;
    }

    #customer-info-popup-overlay .form-input-popup {
        height: 42px;
        font-size: 14px;
        padding: 10px 20px;
    }

    #customer-info-popup-overlay .form-label-popup {
        font-size: 14px;
        left: 20px;
    }

    #customer-info-popup-overlay .btn-submit-popup {
        height: 42px;
        font-size: 13px;
    }

    #customer-info-popup-overlay .alert-success {
        padding: 12px;
        border-radius: 10px;
    }
}

/* ========================================
   RESPONSIVE - TABLET & DESKTOP
   ======================================== */
@media (min-width: 768px) {
    #customer-info-popup-overlay .login-popup-title {
        font-size: 28px;
    }

    #customer-info-popup-overlay .benefit-text p {
        font-size: 14px;
    }

    #customer-info-popup-overlay .form-row-popup {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    #customer-info-popup-overlay {
        align-items: center;
    }

    #customer-info-popup-overlay .login-popup-container {
        max-width: 512px;
        border-radius: 12px;
        animation: zoomIn 0.2s ease-out;
    }

    #customer-info-popup-overlay.closing .login-popup-container {
        animation: zoomOut 0.2s ease-out;
    }
}

/* Flatpickr Calendar Integration */
#customer-info-popup-overlay .flatpickr-calendar {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

#customer-info-popup-overlay .flatpickr-day.selected {
    background-color: #E02020;
    border-color: #E02020;
}

#customer-info-popup-overlay .flatpickr-day.selected:hover {
    background-color: #c91c1c;
    border-color: #c91c1c;
}

/* Scrollbar styling */
#customer-info-popup-overlay .login-popup-container::-webkit-scrollbar {
    width: 6px;
}

#customer-info-popup-overlay .login-popup-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#customer-info-popup-overlay .login-popup-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#customer-info-popup-overlay .login-popup-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Flatpickr Calendar - Must display above popup */
.flatpickr-calendar {
    z-index: 1000002 !important;
}

.flatpickr-calendar.open {
    z-index: 1000002 !important;
}

.flatpickr-calendar.inline {
    z-index: 1000002 !important;
}

/* Date input styling */
#customer-info-popup-overlay .date-input {
    cursor: pointer;
}

#customer-info-popup-overlay .date-input.flatpickr-input {
    background-color: white;
}

#customer-info-popup-overlay .date-input.flatpickr-input.active {
    border-color: #6b7280;
}
