/* ========================================
   ANALYTICS, LOYALTY & ALERTS SECTIONS
   ======================================== */

/* === ANALYTICS SECTION === */
.analytics-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.analytics-header {
    margin-bottom: 32px;
}

.analytics-header h1 {
    color: #fff;
    font-size: 32px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.analytics-header p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.analytics-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.analytics-stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.analytics-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.analytics-stat-icon.diamonds {
    background: linear-gradient(135deg, #00ff99, #00cc7a);
}

.analytics-stat-icon.sessions {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.analytics-stat-icon.viewers {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.analytics-stat-icon.duration {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.analytics-stat-label {
    color: #888;
    font-size: 14px;
    margin-bottom: 8px;
}

.analytics-stat-value {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
}

.analytics-chart-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.analytics-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.analytics-chart-header h2 {
    color: #fff;
    font-size: 20px;
    margin: 0;
}

.analytics-chart-canvas {
    position: relative;
    height: 300px;
}

.analytics-history-table {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    overflow-x: auto;
}

.analytics-history-table h2 {
    color: #fff;
    font-size: 20px;
    margin: 0 0 20px 0;
}

.analytics-history-table table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-history-table thead th {
    color: #888;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics-history-table tbody td {
    color: #fff;
    padding: 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.analytics-history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.analytics-session-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.analytics-session-status.ended {
    background: rgba(0, 255, 153, 0.15);
    color: #00ff99;
}

.analytics-session-status.active {
    background: rgba(255, 153, 0, 0.15);
    color: #ff9900;
}

.analytics-btn-export {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.analytics-btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

/* === LOYALTY SECTION === */
.loyalty-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.loyalty-header {
    margin-bottom: 32px;
}

.loyalty-header h1 {
    color: #fff;
    font-size: 32px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.loyalty-header p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.loyalty-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.loyalty-stat-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.loyalty-stat-box-label {
    color: #888;
    font-size: 14px;
    margin-bottom: 12px;
}

.loyalty-stat-box-value {
    color: #667eea;
    font-size: 36px;
    font-weight: 700;
}

.loyalty-leaderboard {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.loyalty-leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.loyalty-leaderboard-header h2 {
    color: #fff;
    font-size: 24px;
    margin: 0;
}

.loyalty-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
    align-items: end;
}

.loyalty-podium-place {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.loyalty-podium-place:hover {
    transform: translateY(-5px);
}

.loyalty-podium-place.first {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    border: 2px solid rgba(255, 215, 0, 0.5);
    order: 2;
}

.loyalty-podium-place.second {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.2));
    border: 2px solid rgba(192, 192, 192, 0.5);
    order: 1;
}

.loyalty-podium-place.third {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(184, 115, 51, 0.2));
    border: 2px solid rgba(205, 127, 50, 0.5);
    order: 3;
}

.loyalty-podium-rank {
    font-size: 48px;
    margin-bottom: 8px;
}

.loyalty-podium-name {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.loyalty-podium-points {
    color: #00ff99;
    font-size: 24px;
    font-weight: 700;
}

.loyalty-podium-level {
    color: #888;
    font-size: 14px;
    margin-top: 4px;
}

.loyalty-viewer-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loyalty-viewer-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.loyalty-viewer-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.loyalty-viewer-rank {
    font-size: 20px;
    font-weight: 700;
    color: #888;
    min-width: 40px;
}

.loyalty-viewer-info {
    flex: 1;
}

.loyalty-viewer-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.loyalty-viewer-stats {
    color: #888;
    font-size: 13px;
}

.loyalty-viewer-level {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.loyalty-viewer-points {
    color: #00ff99;
    font-size: 20px;
    font-weight: 700;
    min-width: 100px;
    text-align: right;
}

.loyalty-rewards-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
}

.loyalty-rewards-section h2 {
    color: #fff;
    font-size: 24px;
    margin: 0 0 20px 0;
}

.loyalty-rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.loyalty-reward-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.loyalty-reward-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: #00ff99;
}

.loyalty-reward-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.loyalty-reward-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.loyalty-reward-requirement {
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
}

.loyalty-reward-points {
    color: #00ff99;
    font-size: 18px;
    font-weight: 700;
}

/* === ALERTS SECTION === */
.alerts-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.alerts-header {
    margin-bottom: 32px;
}

.alerts-header h1 {
    color: #fff;
    font-size: 32px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.alerts-header p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.alerts-create-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.alerts-create-section h2 {
    color: #fff;
    font-size: 24px;
    margin: 0 0 20px 0;
}

.alerts-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.alerts-form-group {
    display: flex;
    flex-direction: column;
}

.alerts-form-group label {
    color: #888;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.alerts-form-group input,
.alerts-form-group select,
.alerts-form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.alerts-form-group input:focus,
.alerts-form-group select:focus,
.alerts-form-group textarea:focus {
    outline: none;
    border-color: #00ff99;
    background: rgba(255, 255, 255, 0.08);
}

.alerts-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.alerts-btn-create {
    background: linear-gradient(135deg, #00ff99, #00cc7a);
    color: #000;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.alerts-btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 255, 153, 0.3);
}

.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.alerts-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
}

.alerts-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.alerts-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.alerts-card-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.alerts-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.alerts-message {
    color: #888;
    font-size: 14px;
    margin-bottom: 16px;
    font-style: italic;
}

.alerts-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.alerts-setting {
    display: flex;
    flex-direction: column;
}

.alerts-setting-label {
    color: #666;
    font-size: 12px;
    margin-bottom: 4px;
}

.alerts-setting-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.alerts-actions {
    display: flex;
    gap: 12px;
}

.alerts-btn-test {
    flex: 1;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.alerts-btn-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.alerts-btn-toggle {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.alerts-btn-toggle.active {
    background: rgba(0, 255, 153, 0.2);
    border-color: #00ff99;
    color: #00ff99;
}

.alerts-priority-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 153, 0, 0.2);
    color: #ff9900;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* === LOADING SPINNER === */
.section-loading {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.spinner-large {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00ff99;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
