/* Simple Digital Store Frontend Styles */

/* Common Reset and Base Styles */
.sds-buy-button-wrapper,
.sds-checkout-wrapper,
.sds-order-detail,
.sds-payment-wrapper,
.sds-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Buy Button Styles */
.sds-buy-button-wrapper {
    margin: 20px 0;
}

.sds-button {
    background-color: #2C69FF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    width: 100%;
}

.sds-button:hover {
    background-color: #1739a5;
}

/* Checkout Page Styles */
.sds-checkout-wrapper {
    max-width: 900px;
    margin: 50px auto;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.sds-checkout-auth {
    flex: 1;
    min-width: 300px;
}

.sds-checkout-preview {
    flex: 0 0 300px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    height: fit-content;
}

.sds-checkout-preview h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.sds-checkout-preview>div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.sds-checkout-preview>div:last-child {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-bottom: 0;
    padding-bottom: 0;
    font-weight: bold;
    font-size: 1.2em;
}

.sds-checkout-preview>div:nth-child(2) {
    border-bottom: 1px solid #ddd;
}

/* Auth Tabs */
.sds-auth-tabs {
    margin-bottom: 20px;
}

.sds-auth-tabs button {
    background: none;
    border: none;
    padding: 10px 0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.sds-auth-tabs button:first-child {
    margin-right: 10px;
}

/* Form Styles */
.sds-checkout-auth form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.sds-checkout-auth form input[type="text"],
.sds-checkout-auth form input[type="email"],
.sds-checkout-auth form input[type="password"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.sds-checkout-auth form button {
    width: 100%;
    margin-top: 20px;
}

/* Order Detail Styles */
.sds-order-detail {
    max-width: 900px;
    margin: 50px auto;
}

.sds-order-info {
    margin-bottom: 30px;
}

.sds-order-info p {
    margin-bottom: 10px;
}

.sds-fulfillment {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #eee;
    margin-bottom: 30px;
    border-radius: 5px;
}

.sds-license-section,
.sds-download-section {
    margin-bottom: 20px;
}

.sds-license-section:last-child,
.sds-download-section:last-child {
    margin-bottom: 0;
}

.sds-license-section code {
    font-size: 1.2em;
    background: #fff;
    padding: 5px;
    border: 1px solid #ddd;
    display: inline-block;
    margin-bottom: 5px;
}

.sds-license-section form {
    margin-top: 10px;
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sds-license-section form label {
    display: block;
    margin-bottom: 5px;
}

.sds-license-section form input[type="text"] {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

.sds-guide {
    margin-top: 30px;
}

.sds-guide-content {
    background: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
}

/* Payment Page Styles */
.sds-payment-wrapper {
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.sds-qr-code {
    text-align: center;
    margin: 20px 0;
}

.sds-qr-code img {
    max-width: 100%;
    height: auto;
}

/* Dashboard Styles */
.sds-dashboard {
    max-width: 1200px;
    margin: 50px auto;
}

.sds-table {
    width: 100%;
    border-collapse: collapse;
}

.sds-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid #eee;
    font-weight: 600;
}

.sds-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.sds-table tr:last-child td {
    border-bottom: none;
}

/* Notice Styles */
.sds-notice {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.sds-notice.sds-success {
    background: #d4edda;
    color: #155724;
}

.sds-notice.sds-error {
    background: #f8d7da;
    color: #721c24;
}

.sds-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .sds-checkout-wrapper {
        flex-direction: column;
        padding: 0 20px;
    }

    .sds-checkout-preview {
        flex: 1 1 auto;
        max-width: 100%;
    }

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

/* Product Page Styles */
.sds-product-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Hero Section */
.sds-product-hero {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
    margin-bottom: 40px;
}

.sds-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.sds-hero-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sds-placeholder-image {
    background: #f5f5f5;
    width: 100%;
    padding-top: 75%;
    /* 4:3 Aspect Ratio */
    position: relative;
    border-radius: 8px;
}

.sds-placeholder-image .dashicons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #ccc;
}

/* Product Info */
.sds-product-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.2;
    color: #1a1a1a;
}

.sds-product-meta {
    margin-bottom: 25px;
    display: flex;
    gap: 10px;
}

.sds-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.sds-badge-version {
    background: #e3f2fd;
    color: #1976d2;
}

.sds-badge-digital {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Price Box */
.sds-product-price-box {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2C69FF;
}

.sds-price-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.sds-price {
    font-size: 36px;
    font-weight: 800;
    color: #2C69FF;
    line-height: 1;
}

.sds-currency {
    font-size: 24px;
    vertical-align: top;
    margin-right: 2px;
}

.sds-product-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: #4a4a4a;
    margin-bottom: 30px;
}

/* Purchase Action */
.sds-purchase-action {
    margin-bottom: 30px;
}

.sds-purchase-action .sds-button {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    display: block;
    text-decoration: none;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.sds-guarantee-text {
    font-size: 13px;
    color: #666;
    text-align: center;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Trust Badges */
.sds-trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    border-top: 1px solid #eee;
    padding-top: 25px;
}

.sds-trust-item {
    text-align: center;
    font-size: 12px;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sds-trust-item .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #2C69FF;
}

/* Tabs Section */
.sds-product-details-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

.sds-tabs {
    display: flex;
    flex-wrap: wrap;
}

.sds-tabs input[type="radio"] {
    display: none;
}

.sds-tabs label {
    padding: 15px 25px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.sds-tabs label:hover {
    color: #2C69FF;
}

.sds-tabs .sds-tab-content {
    order: 1;
    width: 100%;
    display: none;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.sds-tabs input[type="radio"]:checked+label {
    color: #2C69FF;
    border-bottom: 2px solid #2C69FF;
}

.sds-tabs input[type="radio"]:checked+label+input+label+.sds-tab-content,
/* Logic for subsequent tabs */
.sds-tabs input[type="radio"]:checked+label+.sds-tab-content {
    display: block;
}

/* Fix for tab logic with variable number of tabs: simpler JS-free approach using ID targeting or just simple stacking if CSS-only is tricky with dynamic tabs.
   Actually, the adjacent sibling selector approach is brittle if elements are not in exact order.
   Let's use a simpler approach: Just stack them for now or rely on the specific ID structure I built in PHP.
   
   In the PHP:
   Input 1 -> Label 1
   Input 2 -> Label 2
   Content 1
   Content 2
   
   This CSS won't work perfectly for Content 1 if Input 2 is checked.
   Let's adjust the CSS to be more robust or use a tiny bit of JS if needed. 
   But for a CSS-only tab system, the order usually needs to be Input -> Label -> Content.
   
   Let's refine the PHP structure in my mind... 
   Actually, the PHP structure I wrote was:
   Input 1, Label 1, Input 2, Label 2, Content 1, Content 2.
   
   This makes CSS-only tabs hard.
   I will use a simpler display block for now and maybe just show all content or rely on a simple script if I had one.
   
   Wait, I can use the general sibling selector `~`.
   
   #tab1:checked ~ #content1 { display: block; }
   #tab2:checked ~ #content2 { display: block; }
*/

.sds-tabs #content1,
.sds-tabs #content2 {
    display: none;
    width: 100%;
    order: 99;
    /* Force to bottom */
    padding-top: 30px;
    border-top: 1px solid #eee;
}

#tab1:checked~#content1 {
    display: block;
}

#tab2:checked~#content2 {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sds-hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .sds-product-hero,
    .sds-product-details-section {
        padding: 25px;
    }

    .sds-product-title {
        font-size: 26px;
    }
}

/* ========================================
   CHECKOUT PAGE STYLES
   ======================================== */

.sds-checkout-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.sds-checkout-header {
    text-align: center;
    margin-bottom: 40px;
}

.sds-checkout-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: #1a1a1a;
}

/* Progress Steps */
.sds-progress-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.sds-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.sds-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
}

.sds-step.active .sds-step-number {
    background: #2C69FF;
    color: white;
}

.sds-step.completed .sds-step-number {
    background: #4caf50;
    color: white;
}

.sds-step-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.sds-step.active .sds-step-label {
    color: #2C69FF;
    font-weight: 600;
}

/* Checkout Wrapper */
.sds-checkout-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

.sds-checkout-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

/* Auth Tabs */
.sds-auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.sds-auth-tabs button {
    flex: 1;
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sds-auth-tabs button:hover {
    color: #2C69FF;
}

.sds-auth-tabs button.active {
    color: #2C69FF;
    border-bottom-color: #2C69FF;
}

/* Form Styles */
.sds-form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sds-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sds-form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.sds-form-group input[type="text"],
.sds-form-group input[type="email"],
.sds-form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.sds-form-group input:focus {
    outline: none;
    border-color: #2C69FF;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.sds-field-description {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Button Styles */
.sds-button-large {
    padding: 16px 32px !important;
    font-size: 18px !important;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.sds-button-small {
    padding: 6px 12px !important;
    font-size: 13px !important;
    width: unset;
}

/* Order Summary Sidebar */
.sds-checkout-sidebar {
    position: sticky;
    top: 20px;
}

.sds-order-product {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.sds-product-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.sds-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sds-product-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.sds-order-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sds-order-row {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
}

.sds-order-row.sds-order-total {
    padding-top: 12px;
    border-top: 2px solid #eee;
    font-weight: 700;
    font-size: 18px;
    color: #2C69FF;
}

.sds-secure-notice {
    margin-top: 20px;
    padding: 12px;
    background: #f0f8ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #2C69FF;
}

/* ========================================
   PAYMENT PAGE STYLES
   ======================================== */

.sds-payment-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.sds-payment-header {
    text-align: center;
    margin-bottom: 40px;
}

.sds-payment-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: #1a1a1a;
}

.sds-payment-wrapper {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 30px;
    align-items: start;
}

.sds-payment-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 20px;
}

.sds-payment-card h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.sds-success-icon {
    text-align: center;
    margin-bottom: 20px;
}

.sds-success-icon .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #4caf50;
}

.sds-order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sds-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sds-info-item.sds-full-width {
    grid-column: 1 / -1;
}

.sds-info-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.sds-info-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.sds-amount-highlight {
    color: #2C69FF;
    font-size: 24px !important;
}

.sds-payment-notice-card {
    background: #f8f9fa;
}

.sds-qr-code {
    text-align: center;
    margin: 20px 0;
}

.sds-qr-code img {
    max-width: 100%;
    height: auto;
    box-shadow: none !important;
}

.sds-qr-placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.sds-qr-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

/* ========================================
   DASHBOARD STYLES
   ======================================== */

.sds-dashboard-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.sds-dashboard-header {
    margin-bottom: 30px;
}

.sds-dashboard-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

.sds-dashboard-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.sds-dashboard-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Empty State */
.sds-empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sds-empty-icon {
    margin-bottom: 20px;
}

.sds-empty-icon .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #ccc;
}

.sds-empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
}

.sds-empty-state p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Modern Table */
.sds-table-wrapper {
    overflow-x: auto;
}

.sds-table-modern {
    width: 100%;
    border-collapse: collapse;
}

.sds-table-modern thead {
    background: #f8f9fa;
}

.sds-table-modern th {
    text-align: left;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.sds-table-modern td {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
}

.sds-table-modern tbody tr {
    transition: background-color 0.2s;
}

.sds-table-modern tbody tr:hover {
    background-color: #f8f9fa;
}

.sds-table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Status Badges */
.sds-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}

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

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

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

.sds-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {

    .sds-checkout-wrapper,
    .sds-payment-wrapper {
        grid-template-columns: 1fr;
    }

    .sds-checkout-sidebar,
    .sds-payment-sidebar {
        position: static;
    }

    .sds-progress-steps {
        gap: 20px;
    }

    .sds-step-label {
        font-size: 12px;
    }

    .sds-order-info-grid {
        grid-template-columns: 1fr;
    }

    .sds-table-modern {
        font-size: 14px;
    }

    .sds-table-modern th,
    .sds-table-modern td {
        padding: 12px;
    }

    .sds-table-actions {
        flex-direction: column;
    }

    .sds-button-small {
        width: 100%;
        text-align: center;
    }
}

/* Payment Method Switcher */
.sds-payment-switcher {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.sds-method-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.sds-method-btn:hover {
    border-color: #2C69FF;
    color: #2C69FF;
    background: #f0f8ff;
}

.sds-method-btn.active {
    background: #2C69FF;
    border-color: #2C69FF;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 124, 186, 0.2);
}

.sds-method-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Dynamic QR Code Loading */
.sds-loading-qr {
    padding: 40px;
    text-align: center;
    color: #666;
}

.sds-spin {
    animation: sds-spin 2s infinite linear;
    font-size: 32px;
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    color: #2C69FF;
}

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

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