/* =================================================================== */
/* CREATORBOOK DASHBOARD STYLES (Professional SaaS Grade) */
/* =================================================================== */

:root {
    --primary-color: #FE0034;
    --primary-dark: #d0002c;
    --secondary-color: #2d3748;
    --text-color: #4a5568;
    --bg-color: #f4f7fa;
    --card-bg: #ffffff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --border-radius: 16px;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: var(--bg-color);
}

.dashboard-container {
    max-width: 1250px;
    margin: 40px auto;
    padding: 0 20px;
}

/* --- 1. HEADER SECTION --- */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    flex-wrap: wrap;
    gap: 20px;
}

.welcome-text h1 {
    font-size: 28px;
    color: #1a202c;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.welcome-text p {
    color: #718096;
    font-size: 15px;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.btn-dash {
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-outline {
    background: white;
    color: var(--secondary-color);
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.btn-outline:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.btn-primary-dash {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(254, 0, 52, 0.25);
}

.btn-primary-dash:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(254, 0, 52, 0.35);
}

/* --- 2. STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 160px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-title {
    color: #718096;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-wallet {
    background: #fff5f5;
    color: var(--primary-color);
}

.icon-earning {
    background: #e6fffa;
    color: #38b2ac;
}

.icon-users {
    background: #ebf8ff;
    color: #4299e1;
}

.icon-click {
    background: #fffaf0;
    color: #ed8936;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #2d3748;
    margin-top: auto;
}

.stat-trend {
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.trend-up {
    color: var(--success-color);
}

.trend-nuetral {
    color: #a0aec0;
}

/* --- 3. MAIN DASHBOARD CONTENT (Charts & Links) --- */
.dashboard-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 35px;
}

@media (max-width: 992px) {
    .dashboard-main {
        grid-template-columns: 1fr;
    }
}

.dash-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.card-header-dash {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

/* Coupon Code Section */
.coupon-box-container {
    background: linear-gradient(145deg, #fff5f5, #fff);
    border: 1px dashed #FE0034;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.coupon-display {
    display: inline-block;
    background: #FE0034;
    color: white;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 2px;
    margin: 15px 0;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(254, 0, 52, 0.3);
    transition: var(--transition);
}

.coupon-display:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(254, 0, 52, 0.4);
}

/* Affiliate Link Section */
.link-box-container {
    background: #f7fafc;
    border: 1px dashed #cbd5e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.link-input-group {
    display: flex;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.link-input-group input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-family: monospace;
    font-size: 14px;
    color: #4a5568;
    outline: none;
}

.link-copy-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.link-copy-btn:hover {
    background: #1a202c;
}

.share-actions {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    color: white;
    transition: var(--transition);
}

.share-wa {
    background: #25D366;
}

.share-wa:hover {
    background: #128c7e;
}

.share-tg {
    background: #0088cc;
}

.share-tg:hover {
    background: #006699;
}

.share-fb {
    background: #1877F2;
}

.share-fb:hover {
    background: #0d5cb8;
}

.share-ig {
    background: #E1306C;
}

/* Generic generic share */
.share-copy {
    background: #718096;
}

.share-copy:hover {
    background: #4a5568;
}

/* --- 4. TRANSACTIONS TABLE --- */
.table-container {
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.dash-table th {
    text-align: left;
    padding: 15px 20px;
    color: #a0aec0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
}

.dash-table td {
    padding: 18px 20px;
    color: #4a5568;
    font-size: 15px;
    border-bottom: 1px solid #f7fafc;
    font-weight: 500;
}

.dash-table tr:last-child td {
    border-bottom: none;
}

.dash-table tr:hover td {
    background: #f8fafc;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-credit {
    background: #c6f6d5;
    color: #22543d;
}

/* Green */
.status-debit {
    background: #fed7d7;
    color: #822727;
}

/* Red */
.status-pending {
    background: #feebc8;
    color: #744210;
}

/* Orange */

/* --- 5. MODAL STYLES --- */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1001;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-box {
    background: white;
    width: 90%;
    max-width: 450px;
    border-radius: 20px;
    padding: 30px;
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

@keyframes modalSlide {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header h3 {
    font-size: 22px;
    color: #1a202c;
    margin-bottom: 5px;
}

.modal-header p {
    color: #718096;
    font-size: 14px;
    margin-bottom: 25px;
}

.form-input {
    width: 100%;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(254, 0, 52, 0.1);
}

.modal-footer {
    display: flex;
    gap: 10px;
}

.btn-block {
    width: 100%;
    flex: 1;
    padding: 14px;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* Toast */
#toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 2000;
    animation: fadeInOut 3s ease forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    10% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    90% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}