﻿/* Dashboard CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --text-color: #333;
    --text-muted: #6c757d;
    --sidebar-width: 250px;
    --header-height: 70px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: #f5f6fa;
    line-height: 1.6;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

    .loading-overlay.show {
        opacity: 1;
        pointer-events: all;
    }

.loading-spinner {
    text-align: center;
    color: var(--secondary-color);
}

    .loading-spinner i {
        font-size: 3rem;
        margin-bottom: 1rem;
        display: block;
    }

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--primary-color);
    color: white;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .logo i {
        font-size: 1.5rem;
        color: var(--secondary-color);
    }

    .logo h1 {
        font-size: 1.25rem;
        font-weight: 600;
    }

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: white;
    border-right: 1px solid var(--border-color);
    z-index: 999;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
}

    .nav-item:hover {
        background-color: var(--light-color);
        color: var(--secondary-color);
    }

    .nav-item.active {
        background-color: rgba(52, 152, 219, 0.1);
        color: var(--secondary-color);
        border-right: 3px solid var(--secondary-color);
    }

    .nav-item i {
        margin-right: 0.75rem;
        width: 1.25rem;
        text-align: center;
    }

    .nav-item .badge {
        margin-left: auto;
        background: var(--secondary-color);
        color: white;
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 500;
    }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
}

.content-section {
    display: none;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

    .section-header h2 {
        color: var(--primary-color);
        font-size: 1.75rem;
        font-weight: 600;
    }

    .section-header p {
        color: var(--text-muted);
        margin-top: 0.5rem;
    }

.section-actions {
    display: flex;
    gap: 0.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

    .stat-card:hover {
        transform: translateY(-2px);
    }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, var(--secondary-color), #5dade2);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, var(--success-color), #58d68d);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, var(--warning-color), #f7dc6f);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, var(--info-color), #5dade2);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

    .stat-change.positive {
        background-color: rgba(39, 174, 96, 0.1);
        color: var(--success-color);
    }

    .stat-change.negative {
        background-color: rgba(231, 76, 60, 0.1);
        color: var(--danger-color);
    }

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: between;
    align-items: center;
}

    .card-header h3 {
        color: var(--primary-color);
        font-size: 1.25rem;
        font-weight: 600;
    }

.card-body {
    padding: 1.5rem;
}

/* Activity Section */
.activity-section {
    margin-bottom: 2rem;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

    .activity-item:last-child {
        border-bottom: none;
    }

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 0.9rem;
    color: white;
}

    .activity-icon.user {
        background: var(--secondary-color);
    }

    .activity-icon.message {
        background: var(--success-color);
    }

    .activity-icon.system {
        background: var(--warning-color);
    }

.activity-content {
    flex: 1;
}

    .activity-content strong {
        color: var(--primary-color);
    }

.activity-time {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: auto;
}

/* Platform Stats */
.platform-stats {
    margin-bottom: 2rem;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* Filters Panel */
.filters-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

    .filter-group label {
        font-weight: 500;
        color: var(--primary-color);
        font-size: 0.9rem;
    }

/* Form Controls */
.form-control {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

    .form-control:focus {
        outline: none;
        border-color: var(--secondary-color);
        box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
    }

/* Buttons */
.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

    .btn-primary:hover:not(:disabled) {
        background: #2980b9;
        transform: translateY(-1px);
    }

.btn-secondary {
    background: var(--light-color);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

    .btn-secondary:hover:not(:disabled) {
        background: #e9ecef;
    }

.btn-outline {
    background: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

    .btn-outline:hover:not(:disabled) {
        background: var(--secondary-color);
        color: white;
    }

.btn-danger {
    background: var(--danger-color);
    color: white;
}

    .btn-danger:hover:not(:disabled) {
        background: #c0392b;
    }

.btn-success {
    background: var(--success-color);
    color: white;
}

    .btn-success:hover:not(:disabled) {
        background: #229954;
    }

.btn-link {
    background: none;
    color: var(--secondary-color);
    border: none;
    padding: 0.25rem 0;
}

    .btn-link:hover {
        text-decoration: underline;
    }

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 1rem;
}

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

    .data-table th {
        background: var(--light-color);
        padding: 1rem;
        text-align: left;
        font-weight: 600;
        color: var(--primary-color);
        border-bottom: 1px solid var(--border-color);
        white-space: nowrap;
    }

    .data-table td {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        vertical-align: middle;
    }

    .data-table tr:hover {
        background-color: rgba(52, 152, 219, 0.05);
    }

    .data-table .status-badge {
        padding: 0.25rem 0.75rem;
        border-radius: 12px;
        font-size: 0.8rem;
        font-weight: 500;
        text-transform: uppercase;
    }

.status-badge.verified {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.status-badge.unverified {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.status-badge.active {
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.status-badge.user {
    background: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.status-badge.bot {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

.platform-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

    .platform-badge.telegram {
        background: rgba(0, 136, 204, 0.1);
        color: #0088cc;
    }

    .platform-badge.whatsapp {
        background: rgba(37, 211, 102, 0.1);
        color: #25d366;
    }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem;
    font-size: 0.8rem;
    min-width: auto;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .page-number:hover {
        background: var(--light-color);
    }

    .page-number.active {
        background: var(--secondary-color);
        color: white;
        border-color: var(--secondary-color);
    }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

    .modal.show {
        display: flex;
    }

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

    .modal-content.small {
        max-width: 400px;
    }

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h3 {
        color: var(--primary-color);
        margin: 0;
    }

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

    .close:hover {
        color: var(--danger-color);
    }

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: var(--primary-color);
    }

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

/* Toast */
.toast {
    position: fixed;
    top: 100px;
    right: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    padding: 1rem 1.5rem;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--success-color);
}

    .toast.show {
        transform: translateX(0);
    }

    .toast.error {
        border-left-color: var(--danger-color);
    }

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.error #toastIcon {
    color: var(--danger-color);
}

.toast:not(.error) #toastIcon {
    color: var(--success-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filters-panel {
        flex-direction: column;
        align-items: stretch;
    }

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

    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--secondary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
