/* Removed @import rules. Ensure base.css, header.css, and footer.css are linked in the HTML where needed. */

the-affiliate {
    width: calc(100% - 2rem);
    max-width: 60rem;
    align-self: center;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    border: 1px solid rgba(var(--primary-rgb), .5);
    background: rgba(0, 0, 0, .75);
    border-radius: .25rem;
    position: relative;
    /* backdrop-filter: blur(1rem); */
    box-shadow: 0px .25rem 1rem 0 rgb(0 0 0 / 50%), inset 0 0 2rem 0 rgba(var(--primary-rgb), calc(var(--glow-intensity) / 3));
}

the-affiliate:not(.is-admin)::before {
    position: absolute;
    display: flex;
    content: ' ';
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .5);
    z-index: 1;
}

the-affiliate:not(.is-admin)::after {
    content: 'coming\Asoon';
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--primary-color);
    font-size: 4rem;
    transform-origin: center;
    transform: rotate(-30deg);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-shadow: 0 .5rem 1rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 2));
    z-index: 2;
}

the-affiliate div.divider {
    flex: 0 0 1px;
    background-color: rgba(var(--primary-rgb), .25);
    align-self: stretch;
}

the-affiliate h1,
the-affiliate h2,
the-affiliate h3 {
    color: var(--primary-color);
    margin-bottom: 0.5em;
}

the-affiliate h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

the-affiliate h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(var(--primary-rgb), .25);
    padding-bottom: 0.5rem;
    margin-top: 0;
}

the-affiliate h3 {
    font-size: 1.2rem;
    margin-top: 1rem;
}

the-affiliate p,
the-affiliate ul {
    line-height: 1.6;
    margin-bottom: 1rem;
}

the-affiliate ul {
    list-style: disc;
    margin-left: 2rem;
}

the-affiliate small {
    color: rgba(var(--primary-rgb), 0.7);
    font-size: 0.9em;
}

/* Tabs */
the-affiliate .tabs {
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid rgba(var(--primary-rgb), .5);
}

the-affiliate .tab-button {
    padding: 1rem 2rem;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 2));
    background: none;
    outline: none;
    border: none;
}

the-affiliate .tab-button.active {
    color: var(--input-color);
    text-shadow: 0 .5rem 1.5rem rgba(var(--input-rgb), calc(var(--glow-intensity) / 2));
}

the-affiliate .tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--secondary-color);
    box-shadow: 0 .5rem 1.5rem rgba(var(--secondary-rgb), calc(var(--glow-intensity) / 2));
}

/* Tab Content */
the-affiliate .tab-content {
    display: none;
    padding: 1rem;
}

the-affiliate .tab-content.active {
    display: block;
}

/* Link Box */
the-affiliate .link-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

the-affiliate .link-box input[type="text"] {
    flex-grow: 1;
    padding: 0.75rem;
    background-color: rgba(var(--input-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    color: var(--primary-color);
    border-radius: .25rem;
}

/* --- Consolidated Affiliate Button Styles --- */
the-affiliate .copy-button,
the-affiliate .email-settings button {
    padding: 0.75rem 1rem; /* Base padding, email settings overrides */
    background-color: var(--secondary-color);
    color: var(--bg-color); /* Assuming --bg-color is defined or intended */
    border: none;
    border-radius: .25rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

/* --- Consolidated Affiliate Button Styles --- */
the-affiliate .signup-button {
    padding: 0.75rem 1rem; /* Base padding, email settings overrides */
    background-color: var(--primary-color);
    color: var(--bg-color); /* Assuming --bg-color is defined or intended */
    border: none;
    border-radius: .25rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

the-affiliate .update-button {
    padding: 0.75rem 1rem; /* Base padding, email settings overrides */
    background-color: var(--primary-color);
    color: var(--bg-color); /* Assuming --bg-color is defined or intended */
    border: none;
    border-radius: .25rem;
    cursor: pointer;
    font-weight: 600;
    transition: secondary-color 0.3s ease;
}

the-affiliate .email-settings button {
    /* Specific padding for email settings button */
    padding: 0.75rem 1.5rem;
    margin-top: 0.5rem; /* Specific margin */
}

the-affiliate .copy-button:hover,
the-affiliate .email-settings button:hover {
    background-color: var(--primary-color);
}

/* Earnings Summary */
the-affiliate .earnings-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

the-affiliate .summary-card {
    background-color: rgba(var(--primary-rgb), 0.1);
    padding: 1rem;
    border-radius: .25rem;
    text-align: center;
    border: 1px solid rgba(var(--primary-rgb), .2);
}

the-affiliate .summary-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--secondary-color);
    text-transform: uppercase;
}

the-affiliate .summary-card .amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
}

/* Chart */
the-affiliate #earnings-chart-container {
    width: 100%;
    min-height: 300px; /* Adjust as needed */
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: .25rem;
    box-sizing: border-box;
}

the-affiliate #d3-chart {
    width: 100%;
    height: 100%;
    position: relative;
}

/* D3 Chart Styles */
the-affiliate #d3-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

the-affiliate #d3-chart path {
    transition: all 0.3s ease;
}

the-affiliate #d3-chart .domain,
the-affiliate #d3-chart .tick line {
    stroke: rgba(var(--secondary-rgb), 0.3);
}

the-affiliate #d3-chart circle {
    transition: all 0.2s ease;
    cursor: pointer;
}

the-affiliate #d3-chart circle:hover {
    filter: brightness(1.2);
}

the-affiliate #d3-chart text {
    font-family: inherit;
}

/* Table */
the-affiliate .table-container {
    overflow-x: auto; /* For responsiveness on small screens */
    margin-bottom: 2rem;
}

the-affiliate #conversions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

the-affiliate #conversions-table th,
the-affiliate #conversions-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(var(--primary-rgb), .2);
}

the-affiliate #conversions-table th {
    background-color: rgba(var(--primary-rgb), 0.15);
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}

the-affiliate #conversions-table tbody tr:nth-child(even) {
    background-color: rgba(var(--primary-rgb), 0.05);
}

the-affiliate #conversions-table tbody tr:hover {
    background-color: rgba(var(--secondary-rgb), 0.1);
}

/* Email Settings */
the-affiliate .email-settings {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), .1);
    border-radius: .25rem;
}

the-affiliate .email-settings p {
    margin-bottom: 1rem;
    font-weight: 600;
}

the-affiliate .email-settings label {
    display: block;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

the-affiliate .email-settings input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: var(--secondary-color); /* Style checkbox color */
}

/* Base styles applied above */
/* the-affiliate .email-settings button { ... } */

/* Hover styles consolidated above */
/* the-affiliate .email-settings button:hover { ... } */


/*********** MEDIA QUERIES START HERE ***********/
@media only screen and (max-width: 720px) {
    the-affiliate {
        width: calc(100% - 1rem);
    }

    the-affiliate .tabs {
        align-self: stretch; /* Full width on mobile */
    }

    the-affiliate .tab-button {
        padding: .75rem;
        font-size: .8rem;
        flex-grow: 1; /* Make buttons fill space */
        text-align: center;
    }

    the-affiliate .earnings-summary {
        grid-template-columns: 1fr 1fr; /* Two columns on smaller screens */
    }

    the-affiliate .summary-card {
        padding: 0.5rem;
    }
    the-affiliate #conversions-table th,
    the-affiliate #conversions-table td {
        padding: 0.5rem;
        font-size: 0.9em;
    }
}

@media only screen and (max-width: 480px) {
    the-affiliate .earnings-summary {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
    the-affiliate .link-box {
        flex-direction: column;
        align-items: stretch;
    }
}
/*********** MEDIA QUERIES END HERE ***********/
