:root {
    --primary-color: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --secondary-color: #10b981;
    --secondary-light: #34d399;
    --secondary-dark: #059669;
    --accent-color: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dark: #d97706;
    --bg-primary: #fff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-dark: #1f2937;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-light: #fff;
    --border-color: #e5e7eb;
    --border-dark: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0/.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0/.1), 0 2px 4px -1px rgb(0 0 0/.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0/.1), 0 4px 6px -2px rgb(0 0 0/.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0/.1), 0 10px 10px -5px rgb(0 0 0/.04);
    --radius-sm: .375rem;
    --radius-md: .5rem;
    --radius-lg: .75rem;
    --radius-xl: 1rem;
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out
}

.course-dashboard-login-wrap p{
    margin: 0 0 0.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden
}

.profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 2rem;
    color: var(--text-light)
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1.5rem
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgb(255 255 255/.2);
    box-shadow: var(--shadow-md)
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.profile-details h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: .25rem
}

.profile-email {
    opacity: .9;
    font-size: 1rem
}

.tabs-container {
    padding: 0
}

.tabs-nav {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
    overflow: hidden
}

.tab-btn {
    flex: 1;
    min-width: fit-content;
    padding: 1rem 1.5rem;
    background: 0 0;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap
}

.tab-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary)
}

.tab-btn.active {
    color: var(--primary-color);
    background: var(--bg-primary)
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    inset: auto 0 -2px;
    height: 2px;
    background: var(--primary-color)
}

.tabs-content {
    padding: 2rem
}

.tab-panel {
    display: none;
    animation: fadeIn var(--transition-normal)
}

.tab-panel.active {
    display: block
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

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

.tab-panel h2,
.order-details-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600
}

.orders-list,
.certifications-list {
    display: grid;
    gap: 1rem
}

.order-card,
.cert-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-fast);
    cursor: pointer
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color)
}

.cert-card {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-primary);
    text-align: left;
    width: 100%;
    color: inherit;
    font: inherit;
    appearance: none
}

.cert-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-2px)
}

.cert-card:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem
}

.order-id {
    font-weight: 600;
    color: var(--primary-color)
}

.order-date {
    color: var(--text-secondary);
    font-size: .875rem
}

.order-body {
    margin-bottom: 1rem
}

.order-product {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: .5rem
}

.order-status,
.status-badge,
.order-status-badge {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500
}

.order-status-badge {
    padding: .5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em
}

.status-completed,
.status-confirmed,
.status-badge.success,
.order-status-badge.status-completed,
.order-status-badge.status-confirmed {
    background: rgb(16 185 129 / 0.10);
    color: var(--secondary-dark);
}

.order-status-badge.status-completed,
.order-status-badge.status-confirmed {
    background: rgb(16 185 129 / 0.15);
}

.status-processing,
.pending-confirmation,
.status-badge.pending,
.order-status.status-pending,
.order-status-badge.status-processing,

.order-status-badge.pending-confirmation {
    background: rgb(245 158 11 / 0.20);
    color: var(--accent-dark);
}

.order-status-badge.status-processing,
.order-status-badge.pending-confirmation {
    background: rgb(245 158 11 / 0.15);
}

.status-unpaid,
.order-status-badge.status-unpaid,
.status-failed {
    background: rgb(239 68 68 / 0.10); 
    color: var(--red-dark, #b91c1c);
}

.order-status-badge.status-unpaid {
    background: rgb(239 68 68 / 0.15);
}

.status-cancelled,
.order-status-badge.status-cancelled {
    background: rgb(107 114 128 / 0.10);
    color: var(--gray-700, #374151);
}

.order-status-badge.status-cancelled {
    background: rgb(107 114 128 / 0.15);
}

.status-in-cart,
.order-status-badge.status-in-cart {
    background: rgb(59 130 246 / 0.10);
    color: var(--blue-dark, #1e3a8a);
}

.order-status-badge.status-in-cart {
    background: rgb(59 130 246 / 0.15);
}

.status-complete,
.order-status-badge.status-complete {
    background: rgb(16 185 129 / 0.10);
    color: var(--secondary-dark);
}

.order-status-badge.status-complete {
    background: rgb(16 185 129 / 0.15);
}

.order-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color)
}

.order-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary)
}

.payments-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm)
}

.payments-table thead {
    background: var(--bg-tertiary)
}

.payments-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: .875rem;
    text-transform: uppercase;
    letter-spacing: .05em
}

.payments-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color)
}

.payments-table tr:hover {
    background: var(--bg-secondary)
}

.cert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    border-radius: var(--radius-md);
    color: var(--text-light);
    flex-shrink: 0
}

.cert-info h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: .5rem
}

.cert-issuer {
    color: var(--text-secondary);
    font-size: .875rem;
    margin-bottom: .25rem
}

.cert-date {
    color: var(--text-tertiary);
    font-size: .875rem
}

.certificate-viewer {
    display: flex;
    flex-direction: column;
    gap: 1rem
}

.certificate-preview {
    width: 100%;
    max-width: 760px;
    max-height: 60vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    background: var(--bg-primary);
    margin-inline: auto
}

.certificate-meta h3 {
    margin-bottom: .25rem
}

.certificate-meta p {
    margin: .125rem 0;
    color: var(--text-secondary)
}

.profile-form {
    max-width: 700px
}

.form-group {
    margin-bottom: 1.5rem
}

.form-group label {
    display: block;
    margin-bottom: .5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: .875rem
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: .75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all var(--transition-fast)
}

.form-group select {
    height:100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(79 70 229/.1)
}

.form-group textarea {
    resize: vertical;
    font-family: inherit
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color)
}

.btn {
    padding: .75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast)
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light)
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md)
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary)
}

.btn-secondary:hover {
    background: var(--border-dark)
}

.dialog {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: 1000
}

.dialog.is-open {
    opacity: 1;
    pointer-events: all
}

.dialog-overlay {
    position: absolute;
    inset: 0;
    background: rgb(15 23 42/.65);
    backdrop-filter: blur(2px)
}

.dialog-panel {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgb(15 23 42/.3);
    max-width: 900px;
    width: min(90vw, 900px);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column
}

.dialog-content {
    padding: 3rem 2rem 2rem;
    overflow-y: auto
}

.dialog-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: rgb(15 23 42 / .05);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-close:hover {
    background: rgb(15 23 42/.15)
}

.order-details-viewer {
    width: 100%
}

.order-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color)
}

.order-details-header h2 {
    margin: .5rem 0 0
}

.order-meta {
    color: var(--text-secondary);
    font-size: .9rem;
    margin: 0
}

.order-details-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color)
}

.order-details-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0
}

.order-details-section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
    font-weight: 600
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: .5rem
}

.detail-item-full {
    grid-column: 1/-1
}

.detail-label {
    font-size: .875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em
}

.detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6
}

.product-items,
.summary-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem
}

.summary-items {
    gap: .75rem
}

.product-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast)
}

.product-item:hover {
    background: var(--bg-tertiary)
}

.product-image {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-md);
    flex-shrink: 0
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem
}

.product-name {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 600
}

.product-description {
    font-size: .9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: .5rem;
    color: var(--text-secondary);
    font-size: .875rem
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color)
}

.order-summary {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: none
}

.order-summary h3 {
    margin-bottom: 1rem
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    color: var(--text-primary)
}

.summary-row span:first-child {
    color: var(--text-secondary)
}

.summary-total {
    padding-top: .75rem;
    margin-top: .5rem;
    border-top: 2px solid var(--border-color);
    font-size: 1.25rem;
    font-weight: 700
}

.summary-total span {
    color: var(--text-primary)
}

@media (max-width:768px) {
    body {
        padding: 1rem .5rem
    }

    .container {
        border-radius: var(--radius-lg)
    }

    .profile-header {
        padding: 1.5rem
    }

    .profile-info {
        flex-direction: column;
        text-align: center
    }

    .profile-details h1 {
        font-size: 1.5rem
    }

    .tabs-nav {
        overflow-x: auto;
        overflow-y: hidden
    }

    .tab-btn {
        padding: .875rem 1rem;
        font-size: .875rem
    }

    .tabs-content {
        padding: 1.5rem
    }

    .tab-panel h2 {
        font-size: 1.5rem
    }

    .payments-table {
        display: block;
        overflow-x: auto
    }

    .cert-card {
        flex-direction: column;
        text-align: center
    }

    .cert-icon {
        margin: 0 auto
    }

    .form-row {
        grid-template-columns: 1fr
    }

    .form-actions {
        flex-direction: column-reverse
    }

    .form-actions .btn {
        width: 100%
    }

    .dialog {
        padding: .5rem
    }

    .dialog-panel {
        width: 100%;
        height: calc(100vh - 1rem);
        border-radius: var(--radius-lg)
    }

    .dialog-content {
        padding: 3.5rem 1rem 1.5rem
    }

    .certificate-preview {
        max-height: 45vh
    }

    .order-details-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start
    }

    .details-grid {
        grid-template-columns: 1fr
    }

    .product-item {
        flex-direction: column
    }

    .product-image {
        width: 100%;
        height: 200px
    }

    .order-summary {
        padding: 1rem
    }
}

@media (max-width:480px) {
    .profile-avatar {
        width: 80px;
        height: 80px
    }

    .profile-details h1 {
        font-size: 1.25rem
    }

    .order-header {
        flex-direction: column;
        gap: .5rem
    }
}

.no-orders,
.no-payments,
.no-courses {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.loading,
.error {
    padding: 2rem;
    text-align: center;
}

.loading {
    color: var(--primary-color);
}

.error {
    color: #dc2626;
    background: #fee;
    border-radius: var(--radius-md);
}

.cert-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-color);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* WooCommerce Integration Styles */
.woocommerce-account .course-dashboard-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

