/* ============================================
   📍 استایل‌های مدیریت آدرس - تم سورمه‌ای و نقره‌ای
   ============================================ */

/* 🎨 رنگ‌های اصلی تم (سورمه‌ای و نقره‌ای) */
:root {
    --navy-dark: #0f1a2c;          /* سورمه‌ای تیره */
    --navy-primary: #1a2a3a;       /* سورمه‌ای اصلی */
    --navy-medium: #2c3e50;        /* سورمه‌ای متوسط */
    --navy-light: #34495e;         /* سورمه‌ای روشن */
    --navy-lighter: #4a6a8a;       /* سورمه‌ای روشن‌تر */
    --silver: #bdc3c7;             /* نقره‌ای */
    --silver-light: #ecf0f1;       /* نقره‌ای خیلی روشن */
    --silver-medium: #d5dbdb;      /* نقره‌ای متوسط */
    --silver-dark: #95a5a6;        /* نقره‌ای تیره */
    --text-dark: #1a1a2e;          /* متن تیره */
    --text-light: #7f8c8d;         /* متن روشن */
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(15, 26, 44, 0.12);
    --shadow-hover: 0 8px 30px rgba(15, 26, 44, 0.2);
    --border-color: #d5dbdb;
}

/* 📋 هدر صفحه */
.page-header-addresses {
    margin-bottom: 2rem;
}

.page-header-addresses h1 {
    color: var(--navy-dark);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header-addresses h1 i {
    color: var(--navy-medium);
}

.page-header-addresses p {
    color: var(--text-light);
    font-size: 1rem;
}

/* 🧭 مسیر یابی (Breadcrumb) */
.breadcrumb-custom {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb-custom li {
    display: flex;
    align-items: center;
}

.breadcrumb-custom a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-custom a:hover {
    color: var(--navy-medium);
}

.breadcrumb-custom .separator {
    margin: 0 8px;
    color: var(--silver-dark);
}

.breadcrumb-custom .active {
    color: var(--navy-dark);
    font-weight: 600;
}

/* ➕ دکمه افزودن آدرس */
.btn-add-address {
    background: var(--navy-dark);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
}

.btn-add-address:hover {
    background: var(--navy-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-add-address i {
    font-size: 1.1rem;
}

/* 📝 فرم آدرس */
.address-form-wrapper {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.address-form-wrapper .form-title {
    color: var(--navy-dark);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--silver-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-form-wrapper .form-title i {
    color: var(--navy-medium);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-grid label {
    display: block;
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--silver-light);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--silver-light);
    color: var(--text-dark);
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border-color: var(--navy-medium);
    outline: none;
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(44, 62, 80, 0.1);
}

.form-grid input::placeholder,
.form-grid textarea::placeholder {
    color: var(--silver-dark);
}

.form-grid textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--silver-light);
}

.btn-cancel {
    background: var(--silver-light);
    color: var(--text-dark);
    border: none;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: var(--silver);
    transform: translateY(-2px);
}

.btn-submit {
    background: var(--navy-dark);
    color: var(--white);
    border: none;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-submit:hover {
    background: var(--navy-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 📋 لیست آدرس‌ها */
.addresses-list-wrapper {
    margin-top: 2rem;
}

/* 🃏 کارت آدرس */
.address-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.address-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: var(--navy-lighter);
}

/* 🟦 کارت پیش‌فرض - با سورمه‌ای */
.address-card.default {
    border: 2px solid var(--navy-medium);
    background: linear-gradient(135deg, 
        rgba(44, 62, 80, 0.06), 
        rgba(44, 62, 80, 0.02)
    );
    box-shadow: 0 4px 20px rgba(44, 62, 80, 0.15);
}

.address-card.default::before {
    content: '⭐';
    position: absolute;
    top: -12px;
    right: -10px;
    font-size: 18px;
    background: var(--navy-medium);
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.3);
    z-index: 1;
}

.address-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.address-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.default-badge {
    background: var(--navy-medium);
    color: var(--white);
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* 🎯 دکمه‌های اقدام */
.address-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.address-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    background: var(--silver-light);
    color: var(--navy-dark);
}

.address-actions button:hover {
    transform: scale(1.1);
}

/* ✏️ دکمه ویرایش */
.btn-edit-addr:hover {
    background: var(--navy-medium);
    color: var(--white);
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.3);
}

/* 🗑️ دکمه حذف */
.btn-delete-addr {
    color: #e74c3c;
}

.btn-delete-addr:hover {
    background: #e74c3c;
    color: var(--white);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

/* ⭐ دکمه انتخاب پیش‌فرض */
.btn-default-addr {
    color: var(--navy-medium);
}

.btn-default-addr:hover {
    background: var(--navy-medium);
    color: var(--white);
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.3);
}

/* 📋 جزئیات آدرس */
.address-details {
    color: var(--text-light);
}

.address-details p {
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-details i {
    width: 20px;
    color: var(--navy-medium);
    font-size: 0.95rem;
}

.address-full {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--silver-light);
    border-radius: 8px;
    border-right: 3px solid var(--navy-medium);
}

/* ⏳ لودینگ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--silver-light);
    border-top: 4px solid var(--navy-medium);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    margin-top: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

/* 📭 حالت خالی */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--silver-light);
    border-radius: 16px;
    border: 2px dashed var(--silver);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    color: var(--navy-dark);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-light);
}

.retry-btn {
    background: var(--navy-dark);
    color: var(--white);
    border: none;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: var(--shadow);
}

.retry-btn:hover {
    background: var(--navy-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ✨ انیمیشن ورود کارت‌ها */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.address-card {
    animation: fadeInUp 0.4s ease forwards;
}

.address-card:nth-child(2) {
    animation-delay: 0.05s;
}
.address-card:nth-child(3) {
    animation-delay: 0.1s;
}
.address-card:nth-child(4) {
    animation-delay: 0.15s;
}
.address-card:nth-child(5) {
    animation-delay: 0.2s;
}

/* 📱 واکنش‌گرا */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid .full-width {
        grid-column: 1;
    }
    
    .address-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .address-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .page-header-addresses h1 {
        font-size: 1.5rem;
    }
    
    .address-form-wrapper {
        padding: 1.25rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .address-card.default::before {
        top: -8px;
        right: -8px;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .address-card {
        padding: 1rem;
    }
    
    .address-name {
        font-size: 1rem;
    }
    
    .address-actions button {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .btn-add-address {
        width: 100%;
        justify-content: center;
    }
    
    .address-full {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
}