/* Base Styles */
:root {
    --primary-color: #14498c;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --border-color: #e5e7eb;
    --background-color: #f9fafb;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}


/* Forms */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    height: auto;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(20, 73, 140, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    transition: all 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(20, 73, 140, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    display: none;
    min-width: 200px;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
}

.dropdown-item:hover {
    background: rgba(20, 73, 140, 0.05);
    color: var(--primary-color);
}

.dropdown-item.text-danger {
    color: var(--danger-color);
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

.modal-backdrop {
    position: relative !important;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
    pointer-events: none;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - (1.75rem * 2));
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.3rem;
    outline: 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 0.3rem;
    border-top-right-radius: 0.3rem;
    background-color: #f8f9fa;
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-size: 1.25rem;
    font-weight: 500;
    color: #212529;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.25rem;
    background-color: #fff;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: 0.3rem;
    border-bottom-left-radius: 0.3rem;
    background-color: #f8f9fa;
}

.modal-footer > :not(:first-child) {
    margin-left: 0.25rem;
}

.modal-footer > :not(:last-child) {
    margin-right: 0.25rem;
}

.close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.close:hover {
    opacity: 0.75;
}

.close:focus {
    outline: none;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-warning i {
    margin-right: 0.5rem;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.badge.bg-success {
    background-color: var(--success-color);
    color: white;
}

/* Address Card Specific Styles */
.address-card {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    margin-bottom: 1rem;
}

.address-card:hover {
    box-shadow: var(--shadow-md);
}

.address-card .card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-color);
}

.address-card .card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.address-card .address-details {
    padding: 1rem;
}

.address-card .address-details p {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.address-card .address-details i {
    margin-right: 0.5rem;
    color: var(--secondary-color);
    width: 1.25rem;
    text-align: center;
}

.address-card .edit-form {
    display: none;
    padding: 1rem;
}

.address-card.editing .edit-form {
    display: block;
}

.address-card.editing .address-details {
    display: none;
}

.address-card .form-control {
    margin-bottom: 1rem;
}

.address-card .form-label {
    font-weight: 500;
    color: var(--text-color);
}

.address-card .btn-save {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.address-card .btn-save:hover {
    background-color: #0d3a6b;
}

.address-card .btn-cancel {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    margin-right: 0.5rem;
}

.address-card .btn-cancel:hover {
    background-color: #4b5563;
}

.address-card .btn-link {
    color: var(--secondary-color);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
}

.address-card .btn-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.address-card .btn-link i {
    margin-right: 0.25rem;
}

/* Additional Address Section */
.additional-address {
    margin-top: 2rem;
    text-align: center;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.btn-add:hover {
    background-color: #0d3a6b;
    transform: translateY(-1px);
}

.btn-add i {
    margin-right: 0.5rem;
}

/* Dropdown Menu for Address */
.dropdown-address {
    position: relative;
}

.dropdown-menu-address {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    display: none;
    min-width: 200px;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.dropdown-menu-address.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-menu-address li {
    list-style: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(20, 73, 140, 0.05);
    color: var(--primary-color);
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.05);
    color: var(--danger-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
}

.modal-content {
    position: relative;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Responsive Styles */
@media (max-width: 767.98px) {
    .address-card {
        margin-bottom: 1rem;
    }

    .modal-dialog {
        margin: 1rem;
    }
}

/* Utility Classes */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.ms-2 {
    margin-left: 0.5rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.me-1 {
    margin-right: 0.25rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger-color);
}

.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.h-100 {
    height: 100%;
}

.w-100 {
    width: 100%;
}

.text-center {
    text-align: center;
}

.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.py-md-5 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.g-4 {
    gap: 1.5rem;
}

/* Responsive */
@media (max-width: 767.98px) {
    .profile-section {
        padding: 1rem 0;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .address-card {
        margin-bottom: 1rem;
    }
}

/* Profile Section */
.profile-section {
    background-color: var(--background-color);
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Profile Menu */
.profile-menu-desktop {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    position: sticky;
    top: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.profile-menu-desktop .nav-link {
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.profile-menu-desktop .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 0;
    width: 3px;
    background: var(--primary-color);
    transition: height 0.2s ease;
}

.profile-menu-desktop .nav-link:hover,
.profile-menu-desktop .nav-link.active {
    background: rgba(20, 73, 140, 0.05);
    color: var(--primary-color);
    transform: translateX(5px);
}

.profile-menu-desktop .nav-link:hover::before,
.profile-menu-desktop .nav-link.active::before {
    height: 60%;
}

.profile-menu-desktop .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--secondary-color);
    transition: color 0.2s ease;
}

.profile-menu-desktop .nav-link:hover i,
.profile-menu-desktop .nav-link.active i {
    color: var(--primary-color);
}

.profile-menu-desktop .badge {
    font-size: 0.75rem;
    padding: 0.25em 0.6em;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50px;
    transition: all 0.2s ease;
}

.profile-menu-desktop .nav-link:hover .badge {
    transform: scale(1.05);
}

/* Mobile Menu Styles */
.profile-menu-mobile {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    overflow-y: auto;
}

.profile-menu-mobile.show {
    left: 0;
}

.profile-menu-mobile .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.profile-menu-mobile .nav-link:hover,
.profile-menu-mobile .nav-link.active {
    background: rgba(20, 73, 140, 0.05);
    color: var(--primary-color);
}

.profile-menu-mobile .nav-link i {
    width: 24px;
    margin-right: 0.75rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.profile-menu-mobile .nav-link:hover i,
.profile-menu-mobile .nav-link.active i {
    color: var(--primary-color);
}

.profile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.profile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.profile-menu-mobile-toggle {
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.2s ease;
    z-index: 1051;
}

.profile-menu-mobile-toggle:hover {
    color: var(--primary-color);
}

.profile-menu-mobile-toggle i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

@media (min-width: 992px) {
    .profile-menu-overlay {
        display: none;
    }

    .profile-menu-mobile-toggle {
        display: none;
    }
}

/* Desktop styles */
@media (min-width: 992px) {
    .profile-menu-overlay {
        display: none !important;
    }

    .profile-menu-mobile-toggle {
        display: none;
    }
}

/* Profile Card */
.profile-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: none;
}

.profile-card:hover {
    box-shadow: var(--shadow-md);
}

.profile-card .card-body {
    padding: 1.5rem;
}

.profile-card .card-body-mobile {
    padding: 10px;
}

.profile-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.profile-header .d-flex {
    align-items: center;
}

.profile-avatar {
    margin-right: 1.5rem;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    font-size: 32px;
    background: linear-gradient(135deg, #14498c 0%, #0d3c6b 100%);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(20, 73, 140, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-info {
    padding: 1.5rem;
}

.info-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    height: 100%;
}

.info-card .card-title {
    color: #14498c;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card .card-text {
    color: #374151;
    font-size: 1rem;
    line-height: 1.5;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: #6b7280;
    font-size: 0.9rem;
}

.breadcrumb-item a:hover {
    color: #14498c;
}

.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 6px;
}

.alert {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert i {
    color: #14498c;
}

/* Remove the specific card alert margin override */
.profile-card .alert {
    margin: 1.5rem;
}

.pb-4 {
    padding-bottom: 1.5rem !important;
}

@media (max-width: 768px) {
    .profile-section {
        padding: 1rem 0;
    }

    .profile-header {
        text-align: center;
        padding: 1rem;
    }

    .profile-header .d-flex {
        flex-direction: column;
    }

    .profile-avatar {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .avatar-circle {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }

    .info-card {
        margin-bottom: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Order Status Styles */
.order-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.order-details {
    display: none;
    transition: all 0.3s ease;
}

.order-details.show {
    display: block;
}

.order-details-toggle {
    transition: transform 0.3s ease;
}

.order-details-toggle.active {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .order-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .order-header .text-end {
        text-align: center !important;
    }

    .order-item {
        padding: 1rem;
    }

    .profile-menu-desktop {
        display: none !important;
    }
}

.profile-form .form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.profile-form .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.profile-form .input-group .btn {
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1rem;
}

.profile-form .input-group .form-control {
    border-radius: 8px 0 0 8px;
}

.password-toggle {
    color: #6b7280;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    color: #4f46e5;
}

.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.bg-light {
    background-color: #f9fafb !important;
}

.card-title {
    color: #4f46e5;
    font-size: 1.1rem;
    font-weight: 600;
}

.list-unstyled li {
    color: #4b5563;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .profile-form .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}
