/**
 * Frontend Saved Addresses Styles
 *
 * Styles for the frontend saved addresses management interface
 */

/* Main container */
.dsp-saved-addresses-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.dsp-saved-addresses-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.dsp-saved-addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.dsp-no-addresses {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px dashed #ddd;
    grid-column: 1 / -1;
}

.dsp-add-address-btn {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dsp-add-address-btn:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Address cards */
.dsp-address-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.dsp-address-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dsp-address-content {
    margin-bottom: 15px;
}

.dsp-address-text {
    color: #333;
    line-height: 1.5;
    margin-bottom: 10px;
}

.dsp-address-text strong {
    font-weight: 600;
}

.dsp-address-text br {
    margin-bottom: 5px;
}

.dsp-default-badge {
    display: inline-block;
    background: #007cba;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dsp-address-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dsp-address-actions .button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dsp-set-default-btn {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.dsp-set-default-btn:hover {
    background: #218838;
    border-color: #218838;
}

.dsp-edit-address-btn {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.dsp-edit-address-btn:hover {
    background: #e0a800;
    border-color: #d39e00;
}

.dsp-delete-address-btn {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.dsp-delete-address-btn:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* Modal styles */
.dsp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dsp-modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.dsp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.dsp-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

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

.dsp-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

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

.dsp-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e1e1e1;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* Form styles */
.dsp-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.dsp-form-row:last-child {
    margin-bottom: 0;
}

.dsp-form-field {
    flex: 1;
}

.dsp-form-field label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.dsp-form-field input,
.dsp-form-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.dsp-form-field input:focus,
.dsp-form-field select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.dsp-form-field input:required,
.dsp-form-field select:required {
    border-left: 3px solid #007cba;
}

.required {
    color: #dc3545;
}

/* Message styles */
.dsp-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-width: 300px;
}

.dsp-message-success {
    background: #28a745;
}

.dsp-message-error {
    background: #dc3545;
}

/* Responsive design */
@media (max-width: 768px) {
    .dsp-saved-addresses-section {
        margin-top: 20px;
        padding-top: 15px;
    }

    .dsp-saved-addresses-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dsp-form-row {
        flex-direction: column;
        gap: 0;
    }

    .dsp-modal-content {
        width: 95%;
        margin: 10px;
    }

    .dsp-modal-header,
    .dsp-modal-body,
    .dsp-modal-footer {
        padding: 16px;
    }

    .dsp-address-actions {
        justify-content: center;
    }

    .dsp-message {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* Checkout page styles */
.dsp-checkout-saved-addresses {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.dsp-checkout-saved-billing {
    margin-top: 10px;
}
.dsp-checkout-saved-shipping {
    margin-top: 20px;
}

.dsp-checkout-saved-addresses h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.dsp-saved-billing-addresses,
.dsp-saved-shipping-addresses {
    margin-bottom: 20px;
}

.dsp-saved-billing-addresses h4,
.dsp-saved-shipping-addresses h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.dsp-saved-billing-addresses select,
.dsp-saved-shipping-addresses select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .dsp-address-card,
    .dsp-modal-content {
        background: #2c2c2c;
        color: #e0e0e0;
    }

    .dsp-address-section,
    .dsp-checkout-saved-addresses {
        background: #1a1a1a;
        border-color: #404040;
    }

    .dsp-modal-header,
    .dsp-modal-footer {
        background: #333;
        border-color: #404040;
    }

    .dsp-form-field input,
    .dsp-form-field select,
    .dsp-saved-billing-addresses select,
    .dsp-saved-shipping-addresses select {
        background: #333;
        border-color: #555;
        color: #e0e0e0;
    }

    .dsp-form-field label {
        color: #e0e0e0;
    }
}
