/**
 * Custom CSS for AICQAcademy Client Area
 * Modern, clean styling for WooCommerce my-account area
 */

/* FORCE Layout Reset - Override all existing layouts */
.woocommerce,
.woocommerce-account .woocommerce,
.woocommerce-MyAccount-wrap,
body.woocommerce-account .woocommerce,
body.woocommerce-account .woocommerce-MyAccount-wrap,
.neve-main .woocommerce,
.neve-main .woocommerce-MyAccount-wrap {
    display: block !important;
    flex-direction: column !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

/* Override Neve theme specific styles */
.neve-main .woocommerce-MyAccount-navigation,
.neve-main .woocommerce-MyAccount-content {
    width: 100% !important;
    display: block !important;
}

/* Force vertical stacking */
.woocommerce-MyAccount-navigation,
.woocommerce-MyAccount-content {
    display: block !important;
    width: 100% !important;
    float: none !important;
    flex: none !important;
    grid-column: unset !important;
    grid-row: unset !important;
}

/* Override any existing 2-column layouts */
.woocommerce-account .col2-set,
.woocommerce .col2-set,
.u-columns,
.woocommerce .u-columns {
    display: block !important;
    width: 100% !important;
}

.col-1, .col-2 {
    width: 100% !important;
    float: none !important;
    display: block !important;
}

/* Disable any grid layouts */
.woocommerce-account [class*="grid"],
.woocommerce [class*="grid"] {
    display: block !important;
    grid-template-columns: none !important;
}

/* Navigation as Horizontal Navbar - FORCED */
.woocommerce-MyAccount-navigation {
    background: #ffffff !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 8px !important;
    margin-bottom: 30px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
    width: 100% !important;
    position: relative !important;
    clear: both !important;
    display: block !important;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.woocommerce-MyAccount-navigation ul li {
    flex: 1 !important;
    min-width: 140px !important;
    border-right: 1px solid #e1e5e9 !important;
    text-align: center !important;
    display: flex !important;
    align-items: stretch !important;
}

.woocommerce-MyAccount-navigation ul li:last-child {
    border-right: none;
}

.woocommerce-MyAccount-navigation ul li a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px 12px !important;
    color: #495057 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
    border-bottom: 3px solid transparent !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    width: 100% !important;
    height: 100% !important;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background: #f8f9fa !important;
    color: #007cba !important;
    border-bottom-color: #007cba !important;
    text-align: center !important;
}

.woocommerce-MyAccount-navigation ul li.is-active a {
    background: #e7f3ff !important;
    color: #007cba !important;
    border-bottom-color: #007cba !important;
    font-weight: 600 !important;
    text-align: center !important;
}

/* Fix specific alignment for Dashboard/Bacheca item */
.woocommerce-MyAccount-navigation ul li:first-child a,
.woocommerce-MyAccount-navigation ul li[class*="dashboard"] a,
.woocommerce-MyAccount-navigation ul li a[href*="dashboard"],
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--dashboard a,
.woocommerce-MyAccount-navigation ul li.is-active:first-child a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 16px 12px !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

/* Force reset any specific dashboard styling */
.woocommerce-MyAccount-navigation ul li:first-child {
    text-align: center !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
}

/* Nuclear option - override ALL possible dashboard element styling */
.woocommerce-MyAccount-navigation ul li:first-child *,
.woocommerce-MyAccount-navigation ul li[class*="dashboard"] *,
.woocommerce-MyAccount-navigation-link--dashboard * {
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

/* Content Area - Full Width - FORCED */
.woocommerce-MyAccount-content {
    background: #ffffff !important;
    border: 1px solid #e1e5e9 !important;
    border-radius: 8px !important;
    padding: 30px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
    width: 100% !important;
    clear: both !important;
    display: block !important;
    position: relative !important;
}

/* Tables - Clean and readable */
.woocommerce-MyAccount-content .woocommerce-orders-table,
.woocommerce-MyAccount-content .woocommerce-table,
.woocommerce-MyAccount-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
}

/* Table Headers */
.woocommerce-MyAccount-content th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
    font-size: 14px;
}

/* Table Data */
.woocommerce-MyAccount-content td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    color: #495057;
    vertical-align: middle;
}

.woocommerce-MyAccount-content tr:hover {
    background: #f8f9fa;
}

/* Buttons - Simple and clean */
.woocommerce-MyAccount-content .button,
.woocommerce-MyAccount-content .woocommerce-button {
    background: #007cba;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
    cursor: pointer;
    font-size: 14px;
}

.woocommerce-MyAccount-content .button:hover,
.woocommerce-MyAccount-content .woocommerce-button:hover {
    background: #005a87;
    color: #ffffff;
}

/* Status badges - subtle colors */
.woocommerce-order-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: lowercase;
}

.status-completed,
.status-processing,
.status-on-hold,
.status-pending,
.status-cancelled,
.status-refunded,
.status-failed {
    color: #495057;
    background: #e9ecef;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

/* Course License Styling */
.course-licenses-section {
    margin-bottom: 30px;
}

/* Hide "Le Tue Licenze Corsi" section on licenze-corsi page */
body.woocommerce-account.woocommerce-page .course-licenses-section,
.woocommerce-MyAccount-content .course-licenses-section {
    display: none !important;
}

.course-license-item {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
}

.course-license-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.course-license-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.course-license-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    color: #6c757d;
    font-size: 14px;
}

.course-action-button {
    background: #007cba;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
    cursor: pointer;
    font-size: 14px;
}

.course-action-button:hover {
    background: #005a87;
    color: #ffffff;
}

/* Assigned Licenses Section Styling */
.assigned-licenses-section {
    margin-bottom: 30px;
}

.assigned-licenses-section table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
}

.assigned-licenses-section th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
    font-size: 14px;
}

.assigned-licenses-section td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    color: #495057;
    vertical-align: middle;
}

.assigned-licenses-section tr:hover {
    background: #f8f9fa;
}

/* Status badges for assigned licenses */
.assigned-licenses-section .status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: lowercase;
}

.assigned-licenses-section .status-enrolled,
.assigned-licenses-section .status-active {
    background: #d1ecf1;
    color: #0c5460;
}

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

.assigned-licenses-section .status-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Progress indicators */
.progress-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    width: 80px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #28a745;
    transition: width 0.3s ease;
}

.progress-fill.warning {
    background: #ffc107;
}

.progress-fill.danger {
    background: #dc3545;
}

/* Forms - clean styling */
.woocommerce-MyAccount-content .woocommerce-form-row {
    margin-bottom: 20px;
}

.woocommerce-MyAccount-content label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

.woocommerce-MyAccount-content input[type="text"],
.woocommerce-MyAccount-content input[type="email"],
.woocommerce-MyAccount-content input[type="password"],
.woocommerce-MyAccount-content select,
.woocommerce-MyAccount-content textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.woocommerce-MyAccount-content input:focus,
.woocommerce-MyAccount-content select:focus,
.woocommerce-MyAccount-content textarea:focus {
    border-color: #007cba;
    outline: none;
}

/* Responsive Design for Horizontal Navbar */
@media (max-width: 768px) {
    .woocommerce-MyAccount-navigation ul {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .woocommerce-MyAccount-navigation ul li {
        flex: 0 0 auto;
        min-width: 120px;
    }

    .woocommerce-MyAccount-navigation ul li a {
        padding: 14px 10px;
        font-size: 13px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .woocommerce-MyAccount-content {
        padding: 20px;
    }

    .woocommerce-MyAccount-content table {
        font-size: 14px;
    }

    .woocommerce-MyAccount-content th,
    .woocommerce-MyAccount-content td {
        padding: 10px 8px;
    }

    .course-license-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .course-license-details {
        grid-template-columns: 1fr;
    }
}