/* Profile Page Specific Styles */
.profile-page {
    padding: 20px 0;
    background-color: #f9f9f9;
    min-height: calc(100vh - 200px);
}

.profile-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.profile-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 15px;
    height: fit-content;
    position: relative;
}

.profile-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 20px;
    overflow-x: auto;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--primary-color);
}

.profile-info h2 {
    margin: 0 0 5px;
    color: var(--dark-color);
    font-size: 1.3rem;
}

.profile-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.profile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-menu li {
    margin-bottom: 8px;
}

.profile-menu a {
    display: flex;
    align-items: center;
    padding: 10px;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.profile-menu a:hover,
.profile-menu a.active {
    background-color: var(--primary-color);
    color: white;
}

.profile-menu i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 0.9rem;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.account-details p {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.account-details strong {
    width: 100px;
    display: inline-block;
    color: var(--dark-color);
}

.edit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    width: 100%;
}

.edit-btn:hover {
    background-color: #9e1b42;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.stat-card h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--primary-color);
}

.stat-card p {
    margin: 5px 0 0;
    color: #666;
    font-size: 0.85rem;
}

/* Recent Orders */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.orders-table th,
.orders-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.orders-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.order-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-shipped {
    background-color: #cce5ff;
    color: #004085;
}

.view-order {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.mobile-menu-toggle i {
    margin-right: 8px;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .profile-container {
        grid-template-columns: 240px 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: static;
        margin-bottom: 20px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .profile-menu {
        display: none;
    }

    .profile-menu.active {
        display: block;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .account-details p {
        flex-direction: column;
    }

    .account-details strong {
        width: auto;
        margin-bottom: 3px;
    }
}

@media (max-width: 480px) {
    .profile-header {
        flex-direction: column;
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .profile-content {
        padding: 15px;
    }

    .section-title {
        font-size: 1.1rem;
    }
}

/* Add loading spinner style */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Popup Styles */
.profile-auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.profile-popup-content {
    position: relative;
    background: white;
    border-radius: 8px;
    width: 90%;
    top: 10%;
    left: 36%;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1002;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

@media screen and (max-width:1100px) {
    .profile-popup-content {
        top: 10%;
        left: 24%;
    }
}

@media screen and (max-width:800px) {
    .profile-popup-content {
        top: 10%;
        left: 10%;
    }
}

@media screen and (max-width:700px) {
    .profile-popup-content {
        top: 10%;
        left: 4%;
    }
}

.profile-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.profile-popup-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.profile-close-popup {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.profile-form-group {
    margin-bottom: 15px;
}

.profile-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.profile-form-group input,
.profile-form-group select,
.profile-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

.profile-form-row {
    display: flex;
    gap: 15px;
}

.profile-half-width {
    flex: 1;
}

.profile-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s;
}

.profile-btn:hover {
    background-color: #9e1b42;
}

.profile-map-container {
    height: 200px;
    width: 100%;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.profile-btn-current-location {
    margin-bottom: 15px;
    background-color: #4a6fa5;
}

.profile-btn-current-location:hover {
    background-color: #3a5a80;
}

.profile-success-message,
.profile-error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1100;
    animation: slideIn 0.3s ease-out;
}

.profile-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.profile-error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.profile-fade-out {
    animation: fadeOut 0.3s ease-in;
    opacity: 0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}