/**
 * Express Checkout Modal Styles
 * Ultra-simple 2-click purchase flow
 */

.express-modal,
.success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.express-modal.active,
.success-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.express-modal-content,
.success-modal-content {
    background: #1a1a2e;
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s ease;
}

.express-modal-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.express-modal-header h2 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    color: #999;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.express-modal-body {
    padding: 24px;
}

/* Product Preview */
.product-preview {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.product-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.product-details h3 {
    color: white;
    font-size: 1.25rem;
    margin: 0 0 8px 0;
}

.price-display {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #00ff88, #00cc66);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Dynamic Form Fields */
.express-form {
    margin-bottom: 24px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.field-icon {
    font-size: 1.25rem;
}

.required {
    color: #ff4444;
    font-size: 1rem;
}

.form-field input,
.form-field select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #00ff88;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-field input::placeholder {
    color: #666;
}

.form-field input.error,
.form-field select.error {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.05);
}

.field-hint {
    display: block;
    color: #999;
    font-size: 0.8125rem;
    margin-top: 6px;
}

/* Error Message */
.express-error-message {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

.error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-text {
    color: #ff8888;
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-line;
}

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

/* Express Options */
.express-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.payment-method,
.delivery-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px auto
}

.method-icon,
.info-icon {
    font-size: 1.5rem;
}

.method-details,
.info-text {
    flex: 1;
}

.method-label {
    display: block;
    color: #999;
    font-size: 0.875rem;
}

.method-name {
    color: white;
    font-weight: 600;
}

.info-text strong {
    display: block;
    color: white;
    margin-bottom: 4px;
}

.info-text span {
    color: #999;
    font-size: 0.875rem;
}

.btn-change-payment {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #999;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-change-payment:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

/* Action Buttons */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-confirm-purchase {
    background: linear-gradient(135deg, #00ff88, #00cc66);
    border: none;
    border-radius: 16px;
    padding: 20px;
    color: black;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.btn-confirm-purchase:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.btn-confirm-purchase:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-price {
    font-size: 1.25rem;
    font-weight: 900;
}

.btn-guest-checkout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #999;
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-guest-checkout:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

/* Success Modal */
.success-modal-content {
    text-align: center;
    padding: 40px;
}

.success-animation {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.checkmark {
    width: 100%;
    height: 100%;
    stroke-width: 2;
    stroke: #00ff88;
    stroke-miterlimit: 10;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.3s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.success-modal-content h2 {
    color: white;
    font-size: 2rem;
    margin: 0 0 8px 0;
}

.success-modal-content p {
    color: #999;
    margin: 0 0 32px 0;
}

.delivery-code {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
}

.code-label {
    display: block;
    color: #999;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

#deliveryCode {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: #00ff88;
    letter-spacing: 2px;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.15);
}

.success-actions {
    display: flex;
    gap: 12px;
}

.btn-view-order,
.btn-continue-shopping {
    flex: 1;
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-view-order {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #999;
}

.btn-view-order:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.btn-continue-shopping {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-continue-shopping:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: black;
    animation: spin 0.8s linear infinite;
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Mobile Responsive */
@media (max-width: 520px) {
    .express-modal-content,
    .success-modal-content {
        margin: 10px;
    }

    .express-modal-header {
        padding: 20px;
    }

    .express-modal-body {
        padding: 20px;
    }

    .product-preview {
        flex-direction: column;
        text-align: center;
    }

    .form-field label {
        font-size: 0.875rem;
    }

    .form-field input,
    .form-field select {
        padding: 12px 14px;
        font-size: 0.9375rem;
    }

    .field-hint {
        font-size: 0.75rem;
    }

    .express-error-message {
        padding: 14px;
    }

    .error-text {
        font-size: 0.875rem;
    }

    .success-actions {
        flex-direction: column;
    }

    .btn-confirm-purchase {
        padding: 18px 16px;
        font-size: 1rem;
    }

    .btn-price {
        font-size: 1.125rem;
    }

    .price-display {
        font-size: 1.75rem;
    }

    #deliveryCode {
        font-size: 1rem;
        word-break: break-all;
    }
}