/* ==========================================================================
   IdaToon Coin Chapter Locker Frontend Stylesheet
   ========================================================================== */

/* Variables & Base styling reset */
.idatoon-locked-container, .idatoon-shop-wrapper, .idatoon-user-dashboard-wrap, .idatoon-modal {
    --bg-dark: #0f0f12;
    --bg-card: #18181c;
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --gold-color: #f59e0b;
    --gold-hover: #d97706;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --glass-bg: rgba(24, 24, 28, 0.75);
    --glass-border: rgba(255, 255, 255, 0.06);
    --shadow-premium: 0 15px 35px rgba(0, 0, 0, 0.4);
    
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color-scheme: dark;
}

/* ==========================================================================
   1. Locked Chapter Overlay Page
   ========================================================================== */
.idatoon-locked-container {
    background: var(--bg-dark);
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.idatoon-locked-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 50px 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.idatoon-locked-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.1);
}

.idatoon-locked-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--gold-color));
}

.idatoon-lock-icon-wrap {
    width: 90px;
    height: 90px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 30px;
    color: var(--primary-color);
    box-shadow: inset 0 0 15px rgba(139, 92, 246, 0.2);
    animation: pulseGlow 3s infinite alternate;
}

.idatoon-lock-svg {
    width: 44px;
    height: 44px;
}

.idatoon-locked-card:hover .idatoon-lock-icon-wrap {
    animation: shake 0.6s ease;
    color: var(--gold-color);
    background: rgba(245, 158, 11, 0.1);
    box-shadow: inset 0 0 15px rgba(245, 158, 11, 0.2);
}

.idatoon-locked-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 15px;
    letter-spacing: -0.02em;
}

.idatoon-locked-desc {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 30px;
}

.idatoon-locked-desc strong {
    color: var(--gold-color);
}

.idatoon-user-balance-bar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.idatoon-user-balance-bar .lbl {
    color: var(--text-muted);
    font-size: 14px;
}

.idatoon-user-balance-bar .val {
    color: var(--text-main);
    font-weight: 700;
}

/* Premium Buttons Styling */
.idatoon-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 16px 30px;
    border-radius: 14px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
}

.idatoon-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

.idatoon-btn-primary:hover {
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

.idatoon-btn-gold {
    background: linear-gradient(135deg, var(--gold-color), var(--gold-hover));
    color: #000 !important;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

.idatoon-btn-gold:hover {
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.idatoon-insufficient-notice {
    color: var(--danger-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px;
    border-radius: 8px;
}

.idatoon-login-prompt {
    border-top: 1px solid var(--border-color);
    padding-top: 25px;
    margin-top: 25px;
}

.idatoon-login-prompt p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ==========================================================================
   2. Coin Shop Layout
   ========================================================================== */
.idatoon-shop-wrapper {
    background: var(--bg-dark);
    padding: 60px 20px;
    border-radius: 20px;
    margin: 20px 0;
}

.idatoon-shop-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px;
}

.idatoon-shop-header h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 15px;
    letter-spacing: -0.02em;
}

.idatoon-shop-header p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.idatoon-shop-user-balance {
    display: inline-flex;
    align-items: center;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 30px;
    padding: 10px 24px;
    font-size: 15px;
}

.idatoon-shop-user-balance span {
    color: var(--text-muted);
    margin-right: 8px;
}

.idatoon-shop-user-balance strong {
    color: var(--gold-color);
    font-weight: 700;
}

.idatoon-shop-login-notice {
    display: inline-block;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    color: var(--text-main);
}

.idatoon-shop-login-notice a {
    color: var(--gold-color);
    text-decoration: underline;
    font-weight: 700;
}

.idatoon-packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.idatoon-pack-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.idatoon-pack-card.has-promo {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08);
}

.idatoon-pack-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
}

.idatoon-pack-promo-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
    animation: floatGlow 2s infinite alternate;
}

.idatoon-pack-icon-wrap {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 25px;
    transition: transform 0.3s ease;
}

.idatoon-pack-card:hover .idatoon-pack-icon-wrap {
    transform: rotate(15deg) scale(1.1);
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.3);
}

.idatoon-pack-coin-svg {
    width: 36px;
    height: 36px;
}

.idatoon-pack-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 10px;
}

.idatoon-pack-coins {
    font-size: 36px;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 10px;
}

.idatoon-pack-coins span {
    font-size: 16px;
    color: var(--gold-color);
    font-weight: 600;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.idatoon-pack-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 30px;
}

.idatoon-pack-price .usd {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==========================================================================
   3. Checkout Modal Styles
   ========================================================================== */
.idatoon-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.idatoon-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.idatoon-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    padding: 40px;
    position: relative;
    box-shadow: var(--shadow-premium);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.idatoon-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
}

.idatoon-modal-close:hover {
    color: var(--text-main);
}

.idatoon-modal h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 10px;
}

.idatoon-modal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.idatoon-modal-subtitle strong {
    color: var(--gold-color);
}

.idatoon-payment-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.idatoon-payment-choice {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.idatoon-payment-choice:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateX(3px);
}

.idatoon-payment-choice .logo {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-main);
}

.idatoon-payment-choice.paypal .logo {
    color: #3b82f6;
}

.idatoon-payment-choice.binance .logo {
    color: var(--gold-color);
}

.idatoon-payment-choice .desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   4. User Coin Dashboard
   ========================================================================== */
.idatoon-user-dashboard-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.idatoon-dashboard-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 30px;
    margin-bottom: 40px;
}

.idatoon-dashboard-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 10px;
}

.idatoon-dashboard-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.idatoon-dashboard-balance-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 30px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.idatoon-dashboard-balance-card .lbl {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

.idatoon-dashboard-balance-card .val {
    font-size: 26px;
    font-weight: 800;
    color: var(--gold-color);
    margin-bottom: 15px;
}

.idatoon-dashboard-balance-card .btn-topup {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary-color);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13px;
    border-radius: 20px;
    transition: background 0.3s;
}

.idatoon-dashboard-balance-card .btn-topup:hover {
    background: var(--primary-hover);
}

.idatoon-dashboard-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.idatoon-dashboard-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.idatoon-dashboard-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.01);
}

.idatoon-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.idatoon-dashboard-table th, .idatoon-dashboard-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.idatoon-dashboard-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
}

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

.idatoon-status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-completed, .badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold-color);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.btn-read-now {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    font-weight: 700;
}

.btn-read-now:hover {
    color: var(--primary-hover) !important;
    text-decoration: underline !important;
}

.idatoon-no-records {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    margin: 0;
}

/* ==========================================================================
   5. General Loaders and Common Styles
   ========================================================================== */
.idatoon-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.idatoon-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

.idatoon-checkout-loader .idatoon-spinner {
    margin: 0 auto 10px;
}

/* Keyframes */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    from {
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.2), inset 0 0 15px rgba(139, 92, 246, 0.2);
    }
    to {
        box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), inset 0 0 15px rgba(139, 92, 246, 0.3);
    }
}

@keyframes floatGlow {
    from {
        transform: translateX(-50%) translateY(0);
        box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
    }
    to {
        transform: translateX(-50%) translateY(-3px);
        box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Inline title lock status badges */
.idatoon-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 8px;
    line-height: 1.4;
}

.idatoon-lock-badge.locked {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.idatoon-lock-badge.unlocked {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
