/* Container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
}

/* Profile Tabs */
.profile-tabs {
    margin-bottom: 30px;
}

.tabs-nav {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
    margin-bottom: 0;
}

.tab-link {
    padding: 15px 20px;
    color: var(--gray-text);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.tab-link:hover {
    color: var(--light-text);
}

.tab-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.tab-content {
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 0 0 8px 8px;
    margin-top: 0;
}

/* Hide inactive tabs in auth container (profile page) */
.auth-container .tab-content {
    display: none;
}

.tab-content.active,
.auth-container .tab-content.active {
    display: block;
}

.address-list, .orders-list {
    padding: 30px 20px;
}

.address-actions-main {
    text-align: center;
    margin-top: 20px;
}

.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Pagination Styling */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0 15px;
    gap: 8px;
}

.page-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.page-link.active {
    background-color: var(--primary-color);
    color: white;
}

.address-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 15px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.address-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.address-card p {
    margin: 5px 0;
    color: var(--gray-text);
}

.address-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

.address-actions button {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--light-text);
    padding: 5px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.address-actions button.edit-address:hover {
    background-color: #2a7eff;
    border-color: #2a7eff;
}

.address-actions button.delete-address:hover {
    background-color: #ff3a3a;
    border-color: #ff3a3a;
}

.address-form-container {
    margin-top: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal .form-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

button.secondary-button {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

button.secondary-button:hover {
    background-color: rgba(255, 102, 0, 0.1);
}

.primary-button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    text-align: center;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(255, 102, 0, 0.25);
}

.primary-button:hover {
    background-color: #e65c00;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 102, 0, 0.3);
}

textarea, select {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid #a5a5a5;
    border-radius: var(--border-radius);
    padding: 12px 15px;
    color: var(--light-text);
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
    font-family: inherit;
    font-size: 16px;
}

select {
    min-height: auto;
    height: 48px;
    resize: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: var(--light-text);
}

select option {
    background-color: var(--card-bg);
    color: var(--light-text);
    padding: 8px;
}

/* Fix dropdown visibility */
select, select option {
    z-index: 9999;
}

/* Fix dropdown in modal */
.modal select {
    position: relative;
    z-index: 1000;
}

.modal-overlay {
    z-index: 999;
}

/* Fix for select dropdown in modal */
.modal .form-group {
    position: relative;
}

.modal select {
    position: relative;
}

/* Override browser default styles */
select {
    background-color: var(--input-bg) !important;
    color: var(--light-text) !important;
}

select option {
    background-color: var(--card-bg) !important;
    color: var(--light-text) !important;
}

/* Fix for Firefox */
select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 var(--light-text);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: var(--light-text);
    font-size: 24px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--gray-text);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .modal {
        padding: 15px;
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .close-modal {
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
}

html[dir="rtl"] .tab-link.active::after {
    left: auto;
    right: 0;
}

@media (max-width: 768px) {
    .tabs-nav {
        padding: 0;
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    
    .tab-content {
        padding: 0;
    }
    
    .address-list, .orders-list {
        padding: 20px 10px;
    }
    
    .tab-link {
        padding: 12px 8px;
        font-size: 14px;
        flex: 1;
        text-align: center;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .auth-container {
        padding: 20px 15px;
    }
    
    .auth-form .form-group label {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .auth-form input,
    .auth-form select,
    .auth-form textarea {
        padding: 10px;
        font-size: 14px;
    }
    
    .primary-button,
    .secondary-button {
        padding: 10px 15px;
        font-size: 14px;
        margin-top: 20px;
        text-align: center;
    }
    
    .address-card {
        padding: 15px;
    }
    
    .address-card h4 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .address-card p {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .address-actions button {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Address Grid Styling */
.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.address-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.address-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.address-card p {
    margin-bottom: 8px;
    color: var(--light-text);
}

.address-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.address-actions button {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.address-actions button:hover {
    background-color: var(--primary-color);
    color: white;
}

.address-actions-main {
    margin-top: 20px;
    text-align: center;
}

/* Authentication Pages Styling */
.auth-section {
    padding: 40px 0;
    margin: 0 auto;
}

.section-title {
    color: var(--light-text);
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.auth-container {
    background-color: var(--card-bg);
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-bottom: 30px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--light-text);
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: var(--light-text);
    font-size: 16px;
    transition: var(--transition);
}

.auth-form input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.2);
}

.auth-form small {
    display: block;
    color: var(--gray-text);
    font-size: 12px;
    margin-top: 5px;
}

.auth-form .primary-button {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.auth-form .primary-button:hover {
    background-color: #e65c00;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    color: var(--gray-text);
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.forgot-password {
    text-align: right;
}

.forgot-password a {
    color: var(--gray-text);
    font-size: 14px;
    text-decoration: none;
}

.forgot-password a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* RTL Support */
html[dir="rtl"] .forgot-password {
    text-align: left;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
}

.alert-error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

/* User Profile */
.profile-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.profile-sidebar {
    flex: 1;
    min-width: 250px;
}

.profile-content {
    flex: 3;
    min-width: 300px;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    display: block;
    border: 3px solid var(--primary-color);
}

.profile-menu {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
}

.profile-menu ul {
    list-style: none;
    padding: 0;
}

.profile-menu li {
    margin-bottom: 10px;
}

.profile-menu a {
    display: block;
    padding: 12px 15px;
    color: var(--light-text);
    border-radius: 4px;
    transition: var(--transition);
}

.profile-menu a:hover, .profile-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.profile-box {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
}

.profile-box h2 {
    color: var(--light-text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-section {
        padding: 20px 15px;
    }
    
    .auth-container {
        padding: 20px;
    }
}
