/* ==========================================================================
   My Account Page Styling
   ========================================================================== */

/* 1. Wrapper Layout */
.woocommerce-account .woocommerce,
.tnnt-my-account-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important; /* Prevent wrapping on desktop */
    align-items: flex-start;
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
}

/* 2. User Info Header (Avatar + Name) - Placed Top Full Width or Sidebar Top */
.tnnt-account-header {
    width: 100%;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.tnnt-user-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
    background: #ccc; /* Fallback */
}

.tnnt-user-info h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.tnnt-user-info a.logout-link {
    font-size: 14px;
    color: #333; /* Dark color for logout as per design */
    text-decoration: none;
    font-weight: 500;
}

.tnnt-user-info a.logout-link:hover {
    text-decoration: underline;
}

/* 3. Navigation (Sidebar) */
.woocommerce-account .woocommerce-MyAccount-navigation,
.tnnt-my-account-navigation {
    flex: 0 0 250px !important; /* Fixed width sidebar */
    width: 250px !important;
    max-width: 250px !important;
    margin-right: 0 !important;
    float: none !important; /* Override Woo defaults */
    background: #fff;
    border-right: 1px solid #eee; /* Clean divider */
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin-bottom: 0 !important;
    border-bottom: 1px solid #f5f5f5;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block !important;
    padding: 15px 17px !important; /* Reduced padding to room for border */
    border-left: 3px solid transparent !important; /* Placeholder border */
    color: #555 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease;
    box-sizing: border-box !important; /* Critical for sizing */
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    color: #0071e3 !important;
    background-color: #f9f9f9;
    padding-left: 17px !important; /* Keep padding consistent */
    border-left-color: #e1e1e1 !important; /* Subtle hover border */
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    color: #333 !important;
    font-weight: 700 !important;
    background-color: #f5f5f7;
    border-left-color: #333 !important; /* Just change color */
    padding-left: 17px !important; /* Keep padding consistent */
    cursor: default;
}


/* 4. Content Area */
.woocommerce-account .woocommerce-MyAccount-content,
.tnnt-my-account-content {
    flex: 1 1 auto !important; /* Take remaining space */
    width: auto !important; /* Allow flex to control width */
    min-width: 0; /* Prevent overflow */
    padding-top: 5px;
    float: none !important; /* Override Woo defaults */
}

.woocommerce-account .woocommerce-MyAccount-content p {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

.woocommerce-account .woocommerce-MyAccount-content strong {
    color: #333;
}

/* ==========================================================================
   Login / Register Page Styling
   ========================================================================== */

/* Remove flex wrapper for Login page to allow centering */
.woocommerce-account:not(.logged-in) .woocommerce {
    display: block !important;
    text-align: center;
}

/* Container for Login Form */
#customer_login {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

/* Column Styling (Login & Register) */
#customer_login .u-column1, 
#customer_login .u-column2 {
    flex: 1 1 350px;
    max-width: 400px; /* Reduced width */
    background: #fff;
    padding: 30px; /* Reduced padding */
    border-radius: 8px; /* Slightly tighter radius */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    text-align: left;
}

/* Center if only one column (Login only) */
#customer_login .u-column1:only-child {
    margin: 0 auto;
}

/* Titles */
#customer_login h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

/* Form Styles */
.woocommerce-form-row {
    margin-bottom: 20px;
}

.woocommerce-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.woocommerce-Input {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box; /* Fix width issues */
}

.woocommerce-Input:focus {
    border-color: #0071e3;
    outline: none;
}

/* Button */
.woocommerce-form-login__submit,
.woocommerce-form-register__submit {
    width: 100%;
    margin-top: 10px;
    background: #0071e3 !important;
    color: #fff !important;
    height: 48px;
    border-radius: 6px;
    font-weight: 600 !important;
    font-size: 16px !important;
    border: none !important;
    cursor: pointer;
    transition: background 0.2s;
}

.woocommerce-form-login__submit:hover,
.woocommerce-form-register__submit:hover {
    background: #005bb5 !important;
}

/* Links (Lost Password, Remember Me) */
.woocommerce-form-login__rememberme {
    margin-top: 15px;
    display: inline-block;
}

.woocommerce-LostPassword {
    margin-top: 15px;
    display: block;
    text-align: center;
    font-size: 14px;
}

.woocommerce-LostPassword a {
    color: #666;
    text-decoration: underline;
}

.woocommerce-LostPassword a:hover {
    color: #0071e3;
}


/* Responsive */
@media (max-width: 768px) {
    .woocommerce-account .woocommerce {
        flex-direction: column;
        gap: 20px;
    }
    
    .woocommerce-account .woocommerce-MyAccount-navigation {
        max-width: 100%;
        flex: auto;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li a {
        padding: 12px 15px;
        background: #f9f9f9;
        margin-bottom: 5px;
        border-radius: 4px;
        border-bottom: none;
    }
    
    .tnnt-account-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    #customer_login {
        flex-direction: column;
        padding: 0 15px;
    }
}
