/**
 * Frontend styles for Affinite WP Affiliate
 */

/* General Form Styles */
.affinite-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
}

.affinite-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
	box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label a{
	color:#000000;
	text-decoration: underline;
}
.checkbox-label a:hover{
	text-decoration: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background: #005a87;
    color: #fff;
}

.btn-primary {
    background: #007cba;
}

.btn-secondary {
    background: #666;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.form-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-footer p {
    margin: 5px 0;
    color: #666;
}

.form-footer a {
    color: #007cba;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Notices */
.affinite-notice,
.affinite-error,
.affinite-status-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.affinite-notice {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.affinite-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.affinite-status-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

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

.status-rejected {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.status-suspended {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Dashboard Styles */
.affinite-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
	color:#000000;
}
.affinite-dashboard h2,
.affinite-dashboard h3,
.affinite-dashboard h4,
.affinite-dashboard p,
.affinite-dashboard table,
.affinite-dashboard table td,
.affinite-dashboard table th{
	color:#000000;
}
.affinite-dashboard a{
	color:#007cba;
}

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

.dashboard-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #333;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-number {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #1d2327;
}

/* Dashboard Tabs */
.dashboard-tabs {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
}

.tab-button {
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    white-space: nowrap;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.tab-button.active {
    color: #007cba;
    background: #fff;
    border-bottom: 2px solid #007cba;
}

.tab-content {
    display: none;
    padding: 30px;
}

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

/* Overview Tab */
.overview-content {
    display: grid;
    gap: 30px;
}

.quick-actions h3,
.affiliate-info h3 {
    margin-bottom: 20px;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.info-grid {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.info-item strong {
    min-width: 120px;
    color: #333;
}

.info-item span {
    flex: 1;
    font-family: monospace;
    background: #fff;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.copy-btn {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.copy-btn:hover {
    background: #218838;
}

/* Links Tab */
.links-content {
    display: grid;
    gap: 30px;
}

.link-generator,
.link-templates {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.link-with-copy {
    display: flex;
    gap: 10px;
    align-items: center;
}

.link-with-copy input {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
}

.link-input {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 4px;
}

.saved-links,
.quick-links {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.saved-links h3,
.quick-links h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.no-links {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #666;
}

.generated-link {
    margin-top: 20px;
    padding: 15px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
}

.link-output {
    display: flex;
    gap: 10px;
    align-items: center;
}

.link-output input {
    flex: 1;
}

.template-grid {
    display: grid;
    gap: 15px;
}

.template-item {
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.template-item h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.template-item .link-output {
    margin-top: 10px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.affiliate-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.affiliate-table th,
.affiliate-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.affiliate-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.affiliate-table tr:hover {
    background: #f8f9fa;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    border-top-color: #007cba;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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

/* Top Affiliates */
.affinite-top-affiliates {
    max-width: 600px;
    margin: 20px 0;
}

.affinite-top-affiliates h3 {
    margin-bottom: 20px;
    color: #333;
}

.affiliates-list {
    display: grid;
    gap: 10px;
}

.affiliate-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.affiliate-item .rank {
    font-weight: bold;
    color: #007cba;
    min-width: 30px;
}

.affiliate-item .name {
    flex: 1;
    font-weight: 600;
}

.affiliate-item .conversions,
.affiliate-item .earnings {
    color: #666;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tab-nav {
        overflow-x: scroll;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        text-align: center;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .link-output {
        flex-direction: column;
    }

    .affiliate-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Status indicators */
.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

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

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

/* Creatives Tab */
.creatives-content {
    display: grid;
    gap: 30px;
}

.creatives-header h3 {
    margin-bottom: 10px;
    color: #333;
}

.creatives-header p {
    color: #666;
    margin-bottom: 20px;
}

.no-creatives {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.creatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.creative-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.creative-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.creative-preview {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.creative-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.creative-info {
    padding: 15px;
}

.creative-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.creative-dimensions {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.creative-description {
    color: #666;
    font-size: 14px;
    margin: 10px 0 0 0;
}

.creative-actions {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
}

.creative-actions .btn {
    flex: 1;
    text-align: center;
}

.creative-code-container {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.creative-code-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.creative-code-container textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    background: #fff;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
}

.creative-code-container .copy-code-btn {
    margin-top: 10px;
    width: 100%;
}

@media (max-width: 768px) {
    .creatives-grid {
        grid-template-columns: 1fr;
    }

    .creative-actions {
        flex-direction: column;
    }
}
/* ========================================
   Clicks Tab Styles
   ======================================== */

/* Clicks Tab Container */
.affinite-clicks-tab {
    padding: 20px;
}

/* Clicks Header */
.clicks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.clicks-header h3 {
    margin: 0;
    font-size: 24px;
    color: #1d2327;
}

/* Month Selector */
.month-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-prev-month,
.btn-next-month {
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-prev-month:hover,
.btn-next-month:hover {
    background: #135e96;
}

.btn-prev-month .dashicons,
.btn-next-month .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.current-month-display {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    min-width: 150px;
    text-align: center;
}

/* Stats Grid */
.clicks-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-box:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-box:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-box:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon {
    font-size: 32px;
}

.stat-icon .dashicons {
    width: 32px;
    height: 32px;
    font-size: 32px;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 5px;
}

/* Chart Container */
.clicks-chart-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.clicks-chart-container h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #1d2327;
}

#affinite-clicks-chart {
    max-height: 400px;
}

/* Bottom Grid */
.clicks-bottom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.clicks-sources-box,
.clicks-devices-box {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.clicks-sources-box h4,
.clicks-devices-box h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #1d2327;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* Table Styles */
.affinite-table {
    width: 100%;
    border-collapse: collapse;
}

.affinite-table thead th {
    background: #f6f7f7;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #1d2327;
    border-bottom: 2px solid #e0e0e0;
}

.affinite-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.affinite-table tbody tr:hover {
    background: #f9f9f9;
}

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

/* No Data Message */
.no-data {
    text-align: center;
    color: #646970;
    padding: 20px;
    font-style: italic;
}

/* ========================================
   Commissions Tab Styles
   ======================================== */

.commissions-content {
    display: grid;
    gap: 30px;
}

.commissions-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.summary-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.summary-card h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.summary-card .amount {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #1d2327;
}

.commissions-table {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.commissions-table h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #1d2327;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* Responsive for Commissions */
@media (max-width: 768px) {
    .commissions-summary {
        grid-template-columns: 1fr;
    }
}

/* Disabled Button State */
.btn-prev-month:disabled,
.btn-next-month:disabled,
.btn-prev-month.disabled,
.btn-next-month.disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-prev-month:disabled:hover,
.btn-next-month:disabled:hover,
.btn-prev-month.disabled:hover,
.btn-next-month.disabled:hover {
    background: #ccc;
}

/* Loading State */
.affinite-clicks-tab.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.affinite-clicks-tab.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top-color: #2271b1;
    animation: spin 1s ease-in-out infinite;
    z-index: 1000;
}

/* Responsive */
@media (max-width: 768px) {
    .clicks-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .clicks-stats-grid {
        grid-template-columns: 1fr;
    }

    .clicks-bottom-grid {
        grid-template-columns: 1fr;
    }

    .month-selector {
        width: 100%;
        justify-content: space-between;
    }
}
