/**
 * Button Analytics - CSS Styles
 * עיצוב ממשק הניהול והדוחות
 */

/* ===== עיצוב כללי לעמוד הניהול ===== */
.button-analytics-wrap {
    max-width: 1200px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.button-analytics-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    margin-bottom: 0;
}

.button-analytics-header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.button-analytics-header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 1.1em;
}

/* ===== כרטיסי סטטיסטיקות ===== */
.analytics-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-card-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.8;
}

.stat-card-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
}

.stat-card-label {
    color: #7f8c8d;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* צבעים שונים לכרטיסים */
.stat-card.total-clicks .stat-card-icon { color: #3498db; }
.stat-card.unique-buttons .stat-card-icon { color: #e74c3c; }
.stat-card.avg-daily .stat-card-icon { color: #f39c12; }
.stat-card.top-button .stat-card-icon { color: #27ae60; }

/* ===== טבלאות ===== */
.analytics-table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 30px 0;
}

.analytics-table-header {
    background: #34495e;
    color: white;
    padding: 20px;
    border-bottom: none;
}

.analytics-table-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.analytics-table th,
.analytics-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #ecf0f1;
}

.analytics-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.analytics-table tbody tr:hover {
    background: #f8f9fa;
}

.analytics-table .button-text {
    font-weight: 500;
    color: #2c3e50;
}

.analytics-table .click-count {
    background: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

/* ===== גרפים ותרשימים ===== */
.chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 30px 0;
}

.chart-header {
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.chart-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
}

/* ===== מסננים ובקרות ===== */
.analytics-filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9em;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.filter-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.filter-button:hover {
    background: #2980b9;
}

/* ===== הודעות ואלרטים ===== */
.analytics-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-right: 4px solid;
}

.analytics-alert.info {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.analytics-alert.success {
    background: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

.analytics-alert.warning {
    background: #fff3e0;
    border-color: #ff9800;
    color: #ef6c00;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .analytics-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .analytics-table-container {
        overflow-x: auto;
    }
    
    .analytics-table {
        min-width: 600px;
    }
}

/* ===== אנימציות ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.analytics-table tbody tr {
    animation: fadeIn 0.5s ease;
}

.stat-card {
    animation: fadeIn 0.8s ease;
}

/* ===== אייקונים ===== */
.analytics-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    margin-left: 8px;
}

.analytics-icon.click {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233498db"><path d="M7 4V2C7 1.45 7.45 1 8 1S9 1.55 9 2V4H15V2C15 1.45 15.45 1 16 1S17 1.55 17 2V4H19C20.1 4 21 4.9 21 6V20C21 21.1 20.1 22 19 22H5C3.9 22 3 21.1 3 20V6C3 4.9 3.9 4 5 4H7M5 10V20H19V10H5M7 12H17V18H7V12Z"/></svg>') no-repeat center;
    background-size: contain;
}

/* ===== טעינה ===== */
.analytics-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.analytics-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #3498db;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== כפתור ייצוא ===== */
.export-button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    margin: 10px 5px;
}

.export-button:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    color: white;
}

.export-button:active {
    transform: translateY(0);
}