/**
 * Frontend styles for YITH Affiliate Custom Shares
 */

:root {
    --color-primary: #0073aa;
    --color-border: #e5e7eb;
    --color-bg-light: #f9fafb;
    --color-text-secondary: #6b7280;
    --color-success: #10b981;
    --color-danger: #ef4444;
}

/* Share buttons */
.yacs-share-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.yacs-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.3s ease;
}

.yacs-share-btn:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

.yacs-share-btn.copied {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.yacs-copy-btn {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

.yacs-copy-btn:hover {
    background-color: #0056b3;
    border-color: #003d82;
}

.yacs-copy-btn.copied {
    background-color: #28a745;
    border-color: #1e7e34;
    color: white;
}

/* Notices */
.yacs-notice {
    padding: 12px 15px;
    margin: 15px 0;
    background-color: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 3px;
    color: #333;
}

.yacs-notice.warning {
    background-color: #fff8e5;
    border-left-color: #ffb81c;
}

.yacs-notice.error {
    background-color: #fee;
    border-left-color: #dc3545;
    color: #dc3545;
}

.yacs-notice.success {
    background-color: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

/* Stats container */
.yacs-stats-container {
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    padding: 24px;
}

.yacs-stats-header {
    margin-bottom: 28px;
}

.yacs-stats-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.yacs-stats-title-section h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.yacs-referral-code-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.yacs-referral-code-display svg {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.yacs-referral-code-display strong {
    color: #1f2937;
    font-weight: 600;
}

.yacs-menu-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

.yacs-menu-btn:hover {
    color: #1f2937;
}

.yacs-stats-period-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.yacs-stats-period-filter button {
    padding: 6px 14px;
    background-color: white;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.yacs-stats-period-filter button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.yacs-stats-period-filter button.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Stats grid */
.yacs-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.yacs-stat-card {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    text-align: left;
    transition: all 0.2s;
}

.yacs-stat-card:hover {
    border-color: var(--color-primary);
    background: white;
}

.yacs-stat-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.yacs-stat-card-header svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.yacs-stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
}

.yacs-stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 8px 0;
}

.yacs-stat-card-description {
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* Platform stats section */
.yacs-platform-stats {
    width: 100%;
    margin-bottom: 32px;
}

.yacs-platform-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.yacs-platform-stats-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

/* Platform table grid */
.yacs-platform-table {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.yacs-platform-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    padding: 12px 16px;
    background-color: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
}

.yacs-platform-rows {
    display: flex;
    flex-direction: column;
}

.yacs-platform-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s;
}

.yacs-platform-row:last-child {
    border-bottom: none;
}

.yacs-platform-row:hover {
    background-color: var(--color-bg-light);
}

.yacs-col-platform {
    display: flex;
    align-items: center;
}

.yacs-platform-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.yacs-platform-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    border: 2px solid;
    background: rgba(255, 255, 255, 0.5);
}

.yacs-platform-text {
    flex: 1;
}

.yacs-platform-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.yacs-new-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: #dbeafe;
    color: #1e40af;
    font-size: 10px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: lowercase;
}

.yacs-platform-desc {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.yacs-col-clicks {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yacs-click-bar-wrapper {
    flex: 1;
    height: 4px;
    background-color: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.yacs-click-bar {
    height: 100%;
    border-radius: 2px;
    min-width: 4px;
    transition: width 0.3s;
}

.yacs-click-count {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    min-width: 35px;
    text-align: right;
}

.yacs-col-lastclick {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: right;
}

/* Admin styles */
.yacs-admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.yacs-affiliate-list {
    margin-top: 20px;
}

.yacs-affiliate-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.yacs-affiliate-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.yacs-affiliate-info {
    flex-grow: 1;
}

.yacs-affiliate-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.yacs-affiliate-email {
    font-size: 14px;
    color: #666;
}

.yacs-affiliate-stats-inline {
    display: flex;
    gap: 30px;
    margin-top: 10px;
}

.yacs-affiliate-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yacs-affiliate-stat-label {
    font-size: 13px;
    color: #999;
}

.yacs-affiliate-stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
}

.yacs-affiliate-action {
    display: flex;
    gap: 8px;
}

.yacs-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.yacs-btn-primary {
    background-color: #0073aa;
    color: white;
}

.yacs-btn-primary:hover {
    background-color: #005a87;
}

.yacs-btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.yacs-btn-secondary:hover {
    background-color: #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
    .yacs-stats-grid {
        grid-template-columns: 1fr;
    }

    .yacs-stats-header-top {
        flex-direction: column;
        gap: 12px;
    }

    .yacs-stats-period-filter {
        width: 100%;
    }

    .yacs-platform-table-header,
    .yacs-platform-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .yacs-col-clicks,
    .yacs-col-lastclick {
        grid-column: 1;
    }

    .yacs-click-bar-wrapper {
        width: 100%;
    }

    .yacs-affiliate-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .yacs-affiliate-action {
        width: 100%;
        margin-top: 10px;
    }

    .yacs-share-buttons {
        flex-direction: column;
    }

    .yacs-share-btn {
        width: 100%;
    }
}
