/* css/tracking.css - تنسيقات صفحات التتبع والإحصائيات */

/* صفحة البيكسلات */
.pixels-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.pixel-card {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.pixel-card:hover {
    border-color: #4CAF50;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.2);
}

.pixel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pixel-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 24px;
}

.pixel-logo.facebook { color: #1877F2; }
.pixel-logo.tiktok { color: #000; background: linear-gradient(45deg, #EE1D52, #69C9D0); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.pixel-logo.google { color: #4285F4; }
.pixel-logo.snapchat { color: #FFFC00; }

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4CAF50;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.pixel-form {
    display: grid;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #bbb;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 12px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.pixel-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

.btn-save,
.btn-test {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-save {
    background: #4CAF50;
    color: white;
}

.btn-save:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-test {
    background: #2196F3;
    color: white;
}

.btn-test:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

/* صفحة الإحصائيات */
.statistics-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.stats-title {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.date-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #2a2a2a;
    border-color: #4CAF50;
}

.filter-btn.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.custom-date-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.custom-date-range input[type="date"] {
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 5px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: #4CAF50;
}

.summary-card .icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.summary-card.visitors .icon { color: #2196F3; }
.summary-card.purchases .icon { color: #4CAF50; }
.summary-card.revenue .icon { color: #FFD700; }
.summary-card.conversion .icon { color: #FF5722; }
.summary-card.avg-order .icon { color: #9C27B0; }

.summary-card .label {
    color: #bbb;
    font-size: 14px;
    margin-bottom: 8px;
}

.summary-card .value {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.summary-card .change {
    font-size: 12px;
    margin-top: 8px;
}

.summary-card .change.positive {
    color: #4CAF50;
}

.summary-card .change.negative {
    color: #f44336;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #333;
}

.chart-card h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 20px;
}

.chart-container {
    height: 300px;
}

.products-table-container {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #333;
}

.products-table-container h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 20px;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table thead {
    background: #0a0a0a;
}

.products-table th {
    padding: 15px;
    text-align: right;
    color: #4CAF50;
    font-weight: 600;
    border-bottom: 2px solid #333;
}

.products-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #2a2a2a;
    color: #fff;
}

.products-table tr:hover {
    background: #2a2a2a;
}

.products-table .product-name {
    font-weight: 500;
    color: #4CAF50;
}

.products-table .number {
    font-weight: 600;
}

/* Loading State */
.stats-loading {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}

.stats-loading i {
    font-size: 48px;
    color: #4CAF50;
    animation: spin 1s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}

.empty-state i {
    font-size: 64px;
    color: #4CAF50;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #fff;
}

.empty-state p {
    color: #888;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .stats-title {
        font-size: 24px;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .date-filter {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
        min-width: 80px;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .custom-date-range {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .custom-date-range input[type="date"] {
        flex: 1;
        min-width: 120px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .summary-card .value {
        font-size: 28px;
    }
    
    .chart-card {
        padding: 15px;
    }
    
    .products-table-container {
        padding: 15px;
        overflow-x: auto;
    }
    
    .products-table {
        font-size: 13px;
    }
    
    .products-table th,
    .products-table td {
        padding: 10px 8px;
    }
    
    .pixel-card {
        padding: 15px;
    }
    
    .pixel-form {
        gap: 10px;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .stats-title {
        font-size: 20px;
    }
    
    .filter-btn {
        font-size: 12px;
        padding: 6px 10px;
        min-width: 70px;
    }
    
    .summary-card .value {
        font-size: 24px;
    }
    
    .summary-card .icon {
        font-size: 28px;
    }
}
