/**
 * Smart Directory Pro - WooCommerce My Account Styles
 */

/* Force full width for my account page by overriding theme containers */
body.woocommerce-account #primary,
body.woocommerce-account .content-area,
body.woocommerce-account #main,
body.woocommerce-account .site-content .container,
body.woocommerce-account .site-content .wp-block-template-part,
body.woocommerce-account .site-content,
body.woocommerce-account .entry-content,
body.woocommerce-account .woocommerce,
body.woocommerce-account .woocommerce-MyAccount-content,
/* Also apply to any page with our shortcode */
.page .smart-directory-pro-account-wrapper,
.post .smart-directory-pro-account-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Main Account Wrapper */
.smart-directory-pro-account-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 60px;
    max-width: 1400px !important;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Main Account Container */
.smart-directory-pro-account {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
}

/* Account Header */
.account-header {
    background-color: var(--primary-color);
    padding: 30px;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info img,
.user-info i.fas.fa-user-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 20px;
    background-color: white;
    padding: 3px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.user-info i.fas.fa-user-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: var(--grey-color);
}

/* User details */
.user-details h2 {
    margin: 0 0 5px;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.user-details h2 .logout-link {
    font-size: 14px;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.user-details h2 .logout-link:hover {
    color: white;
    text-decoration: underline;
}

.user-details p {
    margin: 0;
    opacity: 0.8;
    font-size: 16px;
}

/* Account Container */
.account-container {
    display: flex;
    flex-wrap: wrap;
}

/* Account Navigation */
.account-navigation {
    width: 250px;
    background-color: #f7f9ff;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.nav-title {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.nav-title i {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 18px;
}

.nav-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Ensure navigation items are displayed vertically */
.woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block; /* Force vertical layout */
}

.woocommerce-MyAccount-navigation ul li {
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    width: 100% !important; /* Force full width */
    display: block; /* Force block display */
    box-sizing: border-box;
}

.woocommerce-MyAccount-navigation ul li a {
    padding: 15px 30px;
    display: flex;
    align-items: center;
    color: var(--dark-color);
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background-color: rgba(70, 104, 224, 0.05);
    color: var(--primary-color);
}

.woocommerce-MyAccount-navigation ul li.is-active a {
    background-color: rgba(70, 104, 224, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.woocommerce-MyAccount-navigation ul li a i {
    width: 20px;
    margin-right: 10px;
    color: var(--primary-color);
}

/* Account Content */
.account-content {
    flex: 1;
    padding: 30px;
    min-height: 500px;
}

/* Make sure content doesn't overlap with navigation */
.woocommerce-MyAccount-content {
    padding: 30px;
    clear: both; /* Prevent overlap */
    overflow: hidden;
}

/* Override any flex settings from theme */
.woocommerce-account .woocommerce {
    display: block !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
    float: none !important;
    width: 100% !important;
}

/* Dashboard Welcome */
.dashboard-welcome {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-welcome h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.dashboard-welcome p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 0;
    color: var(--grey-color);
}

/* Fix Welcome Text Overlaps */
.account-content h2,
.account-content h3,
.account-content p,
.account-content a {
    max-width: 100%;
    word-wrap: break-word;
    box-sizing: border-box;
}

/* Dashboard Boxes */
.dashboard-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.dashboard-box {
    background-color: #f7f9ff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dashboard-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.box-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(70, 104, 224, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    flex-shrink: 0;
}

.box-icon i {
    color: var(--primary-color);
    font-size: 24px;
}

.dashboard-box h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.dashboard-box p {
    color: var(--grey-color);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
}

.dashboard-box .button {
    width: 100%;
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.dashboard-box .button:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Table Styling */
.woocommerce-MyAccount-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.woocommerce-MyAccount-content table th {
    background-color: #f7f9ff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.woocommerce-MyAccount-content table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.woocommerce-orders-table__row--status-processing .woocommerce-orders-table__cell-order-status {
    color: var(--primary-color);
    font-weight: 500;
}

.woocommerce-orders-table__row--status-completed .woocommerce-orders-table__cell-order-status {
    color: var(--secondary-color);
    font-weight: 500;
}

.woocommerce-orders-table__row--status-cancelled .woocommerce-orders-table__cell-order-status,
.woocommerce-orders-table__row--status-failed .woocommerce-orders-table__cell-order-status {
    color: #ff4d4d;
    font-weight: 500;
}

/* Form Styling */
.woocommerce-MyAccount-content form .form-row {
    margin-bottom: 20px;
}

.woocommerce-MyAccount-content form .form-row label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.woocommerce-MyAccount-content form .form-row input, 
.woocommerce-MyAccount-content form .form-row select,
.woocommerce-MyAccount-content form .form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

.woocommerce-MyAccount-content form .form-row input:focus, 
.woocommerce-MyAccount-content form .form-row select:focus,
.woocommerce-MyAccount-content form .form-row textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.woocommerce-MyAccount-content .button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.woocommerce-MyAccount-content .button:hover {
    background-color: var(--primary-dark);
}

.woocommerce-MyAccount-content .button.secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.woocommerce-MyAccount-content .button.secondary:hover {
    background-color: rgba(70, 104, 224, 0.1);
}

/* Account Sidebar - Learn Section */
.account-sidebar {
    position: relative;
    width: 100%;
}

.learn-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    position: sticky;
    top: 30px;
}

.learn-section h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--dark-color);
}

.learn-section h2:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
}

.learn-posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.learn-post {
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.learn-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.learn-post:hover {
    transform: translateY(-5px);
}

.learn-post-image {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.learn-post-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.learn-post:hover .learn-post-image img {
    transform: scale(1.05);
}

.learn-post-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.learn-post-title {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
}

.learn-post-title a {
    color: var(--dark-color);
    transition: color 0.3s ease;
    text-decoration: none;
}

.learn-post-title a:hover {
    color: var(--primary-color);
}

.learn-post-excerpt {
    color: var(--grey-color);
    font-size: 14px;
    line-height: 1.5;
}

.learn-post-meta {
    font-size: 13px;
    color: var(--grey-color);
}

.learn-post-date i {
    margin-right: 5px;
    color: var(--primary-color);
}

.learn-more {
    margin-top: 25px;
    text-align: center;
}

.learn-more .button {
    width: 100%;
    text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .smart-directory-pro-account-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .account-sidebar {
        margin-top: 0;
    }
    
    .learn-section {
        position: static;
    }
}

@media (max-width: 991px) {
    .account-navigation {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .woocommerce-MyAccount-navigation ul {
        display: flex;
        flex-wrap: wrap;
    }
    
    /* Fixed overlap in navigation at tablet sizes */
    .woocommerce-MyAccount-navigation ul li {
        flex: 1 1 auto;
        width: 50%;
        box-sizing: border-box;
        text-align: center;
        min-width: auto;
        border-bottom: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
    }
    
    .woocommerce-MyAccount-navigation ul li:nth-child(even) {
        border-right: none;
    }
    
    .woocommerce-MyAccount-navigation ul li a {
        padding: 15px 10px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        height: 100%;
    }
    
    .woocommerce-MyAccount-navigation ul li.is-active a {
        border-left: 3px solid var(--primary-color);
        border-bottom: none;
    }
    
    .woocommerce-MyAccount-navigation ul li a i {
        margin-right: 10px;
        font-size: 16px;
        width: auto;
    }
    
    .woocommerce-MyAccount-navigation ul li a span {
        font-size: 14px;
    }
    
    .nav-title {
        display: none;
    }
    
    /* Improve dashboard spacing */
    .dashboard-welcome {
        padding: 0 0 20px 0;
        margin-bottom: 20px;
    }
    
    .dashboard-boxes {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info img,
    .user-info i.fas.fa-user-circle {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .account-content {
        padding: 20px;
    }
    
    .dashboard-boxes {
        grid-template-columns: 1fr;
    }
    
    .learn-post {
        padding-bottom: 15px;
    }
    
    /* Better navigation for small screens */
    .woocommerce-MyAccount-navigation ul li {
        width: 100%;
        border-right: none;
    }
    
    .woocommerce-MyAccount-navigation ul li a {
        justify-content: flex-start;
    }
    
    /* Ensure dashboard welcome text is sized appropriately */
    .dashboard-welcome h2 {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .dashboard-welcome p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Further improve small screen layout */
    .account-content {
        padding: 15px;
    }
    
    .dashboard-welcome h2 {
        font-size: 18px;
    }
    
    .dashboard-welcome p {
        font-size: 14px;
    }
    
    .user-details h2 {
        font-size: 20px;
    }
    
    .user-details p {
        font-size: 14px;
    }
} 