/* ============================================
   Cupidly Admin Panel - Styles
   Modern Dark Theme with RTL Hebrew Support
   ============================================ */

:root {
    --primary: #D4456A;
    --primary-light: #ff6b8a;
    --primary-dark: #b83556;
    --bg-dark: #0f0f12;
    --bg-card: #1a1a1f;
    --bg-sidebar: #141418;
    --bg-input: #242428;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a8;
    --text-muted: #6c6c74;
    --border: #2a2a30;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
}

/* ============================================
   Login Page
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group label i {
    margin-left: 5px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 69, 106, 0.4);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.btn-icon {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ============================================
   Admin Layout
   ============================================ */

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    right: 0;
}

.logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.logo i {
    font-size: 28px;
    color: var(--primary);
}

.logo span {
    font-size: 18px;
    font-weight: 600;
}

/* Navigation Groups */
.nav-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.nav-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-group:last-child {
    border-bottom: none;
}

.nav-group-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-group-header:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-group-header .header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-group-header .arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-group.expanded .nav-group-header .arrow {
    transform: rotate(180deg);
}

.nav-group-items {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.2);
}

.nav-group.expanded .nav-group-items {
    max-height: 500px;
    /* Arbitrary large height for animation */
}

.nav-group-items li {
    margin: 2px 0;
}

.nav-group-items a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 32px;
    /* Indented padding */
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.nav-group-items a:hover,
.nav-group-items li.active a {
    color: var(--primary);
    background: rgba(212, 69, 106, 0.1);
    border-right-color: var(--primary);
}

.nav-group-items a i {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 260px;
    min-height: 100vh;
}

.top-bar {
    padding: 20px 30px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 600;
}

.current-time {
    color: var(--text-secondary);
    font-size: 14px;
}

.content {
    padding: 30px;
}

/* ============================================
   Stats Cards
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    gap: 16px;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.users {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.stat-icon.bots {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.stat-icon.matches {
    background: rgba(212, 69, 106, 0.15);
    color: var(--primary);
}

.stat-icon.messages {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.stat-icon.takeovers {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-info h3 {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-change {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* ============================================
   Tables
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-info p {
    color: var(--text-secondary);
}

.search-input {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    min-width: 250px;
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--bg-sidebar);
    padding: 16px;
    text-align: right;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-medium {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-badge.verified {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.credits-badge {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
}

/* ============================================
   Bots Grid
   ============================================ */

.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.bot-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.2s;
}

.bot-card:hover {
    transform: translateY(-2px);
}

.bot-avatar {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-family: inherit;
}

.bot-avatar:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay i {
    font-size: 32px;
}

.bot-info {
    padding: 16px;
}

.bot-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.bot-city {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.bot-city i {
    margin-left: 4px;
}

.bot-bio {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
}

.bot-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   Match Display
   ============================================ */

.match-users {
    display: flex;
    align-items: center;
    gap: 12px;
}

.match-heart {
    color: var(--primary);
    font-size: 16px;
}

/* ============================================
   Takeover Section
   ============================================ */

.takeover-section {
    margin-bottom: 40px;
}

.takeover-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.takeover-section h2 i {
    color: var(--primary);
}

.takeover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.takeover-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
}

.takeover-card.active {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, var(--bg-card) 100%);
}

.takeover-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.takeover-header h4 {
    font-size: 16px;
    font-weight: 500;
}

.takeover-time {
    font-size: 12px;
    color: var(--text-muted);
}

.takeover-actions {
    display: flex;
    gap: 10px;
}

/* ============================================
   Modals
   ============================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 450px;
    width: 90%;
    border: 1px solid var(--border);
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-content h3 i {
    color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ============================================
   Loading & Utilities
   ============================================ */

.loading {
    color: var(--text-muted);
    text-align: center;
    padding: 30px;
}

code {
    background: var(--bg-input);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary-light);
}

/* ============================================
   Revenue & Charts
   ============================================ */

.revenue-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card.large {
    grid-column: span 2;
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(212, 69, 106, 0.15) 0%, var(--bg-card) 100%);
    border-color: var(--primary);
}

.stat-icon.revenue {
    background: rgba(212, 69, 106, 0.2);
    color: var(--primary);
}

.stat-icon.premium {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.stat-value.big {
    font-size: 36px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.amount-badge {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   Chat Viewer Modal
   ============================================ */

.modal-content.large {
    max-width: 600px;
    width: 90%;
}

.chats-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.chat-item {
    background: var(--bg-input);
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
}

.chat-user {
    display: flex;
    gap: 10px;
    align-items: center;
    grid-column: 1 / -1;
}

.chat-time {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.chat-preview {
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    grid-column: 1 / 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-preview i {
    color: var(--primary);
    margin-left: 5px;
    font-size: 12px;
}

.chat-item button {
    grid-column: 2 / 3;
}

.loading-state,
.error-state {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.page-section {
    margin-top: 30px;
}

.page-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-section h2 i {
    color: var(--primary);
}

/* ============================================
   Dashboard Grid
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
}

.dashboard-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.dashboard-section h2 i {
    color: var(--primary);
}

.chart-container {
    height: 250px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================
   Activity Feed
   ============================================ */

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--border);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.activity-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.activity-icon.primary {
    background: rgba(212, 69, 106, 0.15);
    color: var(--primary);
}

.activity-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-content p {
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-subtitle {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
}

.activity-time {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   Additional Badges
   ============================================ */

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge.bot {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.badge.real {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.bot-indicator {
    color: #a855f7;
    font-size: 12px;
    margin-right: 4px;
}

.bot-match {
    background: rgba(168, 85, 247, 0.03);
}

.status-badge.premium {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    gap: 4px;
}

.status-badge.premium i {
    font-size: 10px;
}

/* ============================================
   Search Form
   ============================================ */

.search-form {
    display: flex;
    gap: 8px;
}

.search-form .search-input {
    flex: 1;
}

/* ============================================
   Takeover Available Card
   ============================================ */

.takeover-card.available {
    border-color: var(--border);
}

.takeover-card.available:hover {
    border-color: var(--primary);
}

.btn-small {
    padding: 8px 14px;
    font-size: 13px;
}

/* ============================================
   User Details
   ============================================ */

.user-cell div {
    display: flex;
    flex-direction: column;
}

.user-cell small {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .logo span,
    .nav-menu a span,
    .logout-btn span {
        display: none;
    }

    .nav-menu a {
        justify-content: center;
    }

    .main-content {
        margin-right: 80px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-right: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }
}

/* ============================================
   Live Chat Interface
   ============================================ */

.chat-modal {
    max-width: 500px;
    height: 600px;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-main);
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 14px;
    position: relative;
}

.message.received {
    align-self: flex-start;
    background: var(--bg-card);
    border-bottom-right-radius: 4px;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: left;
}

.message.sent .message-time {
    text-align: right;
}

.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    background: var(--bg-card);
}

.chat-input-area input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 10px 15px;
    border-radius: 20px;
    color: var(--text-primary);
}

.chat-input-area input:focus {
    border-color: var(--primary);
    outline: none;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.btn-icon:hover {
    color: var(--text-primary);
}

.message-photo img {
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
    display: block;
}

.message-voice audio {
    max-width: 100%;
    height: 35px;
    filter: invert(100%);
    /* Optional: to match dark theme better if needed */
}

/* Fix audio controls color for dark mode */
.message.sent .message-voice audio {
    filter: invert(0%);
}

.message.photo,
.message.voice {
    padding: 8px;
}

/* ============================================
   Recording UI
   ============================================ */

.recording-ui {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-main);
    padding: 0 15px;
    border-radius: 20px;
    flex: 1;
    animation: slideIn 0.3s ease;
}

.pulsing-dot {
    width: 10px;
    height: 10px;
    background: #ff4d4d;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#recording-timer {
    font-family: monospace;
    font-size: 14px;
    color: var(--text-primary);
    min-width: 45px;
}

.text-danger {
    color: #ff4d4d !important;
}

.text-success {
    color: #4caf50 !important;
}

/* Gift Statistics Styles */
.gift-icon {
    font-size: 1.5rem;
    margin-left: 0.5rem;
}

.count-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-weight: 600;
}

.stat-icon.gifts {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff6b6b);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ============================================
   RESPONSIVE DESIGN - Media Queries
   ============================================ */

/* Hamburger Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-right: 220px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .bots-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .takeover-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        right: -280px;
        width: 280px;
        transition: right 0.3s ease;
        z-index: 1001;
    }

    .sidebar.open {
        right: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-right: 0;
    }

    .top-bar {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .top-bar h1 {
        font-size: 18px;
        order: 1;
        flex: 1;
    }

    .mobile-menu-toggle {
        order: 0;
    }

    .current-time {
        order: 2;
        width: 100%;
        text-align: center;
    }

    .content {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .stat-value {
        font-size: 22px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-input {
        width: 100%;
        min-width: auto;
    }

    /* Table Responsiveness */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 10px;
        font-size: 13px;
    }

    .bots-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }

    .bot-avatar {
        height: 160px;
    }

    .takeover-grid {
        grid-template-columns: 1fr;
    }

    /* Modal Adjustments */
    .modal-content {
        max-width: 95%;
        width: 95%;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .chat-modal {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Chat */
    .chat-input-area {
        padding: 10px 15px;
    }

    .chat-input-area input {
        padding: 8px 12px;
    }

    .message {
        max-width: 85%;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: row;
        text-align: right;
    }

    .bots-grid {
        grid-template-columns: 1fr;
    }

    .bot-actions {
        flex-direction: column;
        gap: 8px;
    }

    .bot-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .action-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .login-card {
        padding: 24px;
    }

    .login-logo i {
        font-size: 40px;
    }

    .login-logo h1 {
        font-size: 20px;
    }
}

/* Stories Management */
.stories-grid-container {
    padding: 20px 0;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.story-user-card {
    background: #1a1a1f;
    border-radius: 12px;
    border: 1px solid #2a2a30;
    overflow: hidden;
    padding: 16px;
}

.story-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.story-user-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #3b82f6;
}

.story-user-info {
    flex: 1;
}

.story-user-name {
    font-weight: 600;
    color: white;
}

.story-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.story-item {
    aspect-ratio: 9/16;
    background: #2a2a30;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.story-item:hover {
    transform: scale(1.05);
    border-color: #3b82f6;
}

.story-item img,
.story-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    /* Changed from display:none to opacity for better UX */
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
}

.story-item:hover .story-actions {
    opacity: 1;
    background: #ef4444;
}

/* Print Styles */
@media print {

    .sidebar,
    .mobile-menu-toggle {
        display: none !important;
    }

    .main-content {
        margin-right: 0;
    }

    .modal {
        display: none !important;
    }
}

/* ============================================
   Mobile Responsiveness
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        z-index: 1000;
        display: flex !important;
        flex-direction: column;
        right: 0;
        top: 0;
        bottom: 0;
    }

    .main-content {
        margin-right: 70px;
        width: calc(100% - 70px);
    }

    .logo span,
    .nav-menu a span,
    .logout-btn span {
        display: none;
    }

    .logo {
        justify-content: center;
        padding: 20px 0;
    }

    .logo i {
        margin: 0;
    }

    .nav-menu a {
        justify-content: center;
        padding: 14px;
    }

    .nav-menu a i {
        margin: 0;
        font-size: 18px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .table-container {
        border-radius: 8px;
        overflow-x: auto;
    }

    .top-bar {
        padding: 15px 20px;
    }

    .content {
        padding: 15px;
    }

    /* Layout Fixes */
    .dashboard-grid,
    .stats-grid,
    .takeover-grid,
    .bots-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .header-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .search-form {
        width: 100%;
    }

    .search-input {
        width: 100%;
        max-width: none;
    }
}