/* Adobe Connect Manager – Main Stylesheet (RTL / Persian) */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

/* ─── Custom Properties ────────────────────────────────────────────────────── */
:root {
    --bg-primary:       #0a0e1a;
    --bg-secondary:     #0f1629;
    --bg-card:          #141b2d;
    --sidebar-bg:       #0c1220;
    --sidebar-width:    260px;

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-teal:    linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
    --gradient-gold:    linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-blue:    linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);

    --accent:           #6366f1;
    --accent-hover:     #7c3aed;
    --teal:             #10b981;
    --gold:             #f59e0b;

    --text-primary:     #f1f5f9;
    --text-secondary:   #94a3b8;
    --text-muted:       #64748b;

    --glass-bg:         rgba(255,255,255,0.04);
    --glass-border:     rgba(255,255,255,0.10);
    --glass-hover:      rgba(255,255,255,0.07);

    --border-color:     rgba(255,255,255,0.08);
    --input-bg:         rgba(255,255,255,0.05);

    --shadow-sm:        0 2px 8px rgba(0,0,0,0.3);
    --shadow-md:        0 8px 24px rgba(0,0,0,0.3);
    --shadow-lg:        0 20px 60px rgba(0,0,0,0.4);

    --radius-sm:        8px;
    --radius-md:        12px;
    --radius-lg:        16px;
    --radius-xl:        20px;

    --transition:       all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.6;
    background-image:
        radial-gradient(ellipse at 10% 20%, rgba(99,102,241,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(16,185,129,0.08) 0%, transparent 50%);
}

/* ─── Layout ───────────────────────────────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(99,102,241,0.15) 0%, transparent 100%);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.sidebar-logo .logo-icon {
    width: 42px; height: 42px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
    flex-shrink: 0;
}

.sidebar-logo .logo-text h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-logo .logo-text p {
    font-size: 0.7rem;
    color: var(--text-muted);
    direction: ltr;
}

/* User info in sidebar */
.sidebar-user {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px; height: 36px;
    background: var(--gradient-teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-info .user-name { font-size: 0.875rem; font-weight: 600; }
.user-info .user-role { font-size: 0.72rem; color: var(--text-muted); }

/* Server list in sidebar */
.sidebar-section {
    padding: 1rem;
    flex: 1;
}

.sidebar-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.5rem 0.5rem 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: right;
}

.nav-item:hover { background: var(--glass-hover); color: var(--text-primary); }
.nav-item.active { background: rgba(99,102,241,0.15); color: var(--accent); }
.nav-item.active .nav-dot { box-shadow: 0 0 0 3px rgba(99,102,241,0.3); }

.nav-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-count {
    margin-right: auto;
    font-size: 0.7rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.1rem 0.5rem;
    color: var(--text-muted);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.sidebar-footer a:hover { color: #ef4444; }

/* ─── Main Content ──────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10,14,26,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1;
}

.search-box {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-box input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.55rem 2.5rem 0.55rem 1rem;
    color: var(--text-primary);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.875rem;
    transition: var(--transition);
    direction: rtl;
}

.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(99,102,241,0.08);
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

/* ─── Page Content ──────────────────────────────────────────────────────────── */
.page-content {
    padding: 1.75rem;
    flex: 1;
}

/* ─── Stats Bar ─────────────────────────────────────────────────────────────── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    transition: var(--transition);
}

.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-info .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.card-body { padding: 0; }

/* ─── Table ─────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    padding: 0.85rem 1.1rem;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    background: rgba(255,255,255,0.02);
}

tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: var(--transition);
    cursor: pointer;
}

tbody tr:hover { background: var(--glass-hover); }
tbody tr:last-child { border-bottom: none; }

tbody td {
    padding: 0.85rem 1.1rem;
    vertical-align: middle;
}

/* ─── Server Badge ───────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─── Status Pills ────────────────────────────────────────────────────────────── */
.pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.pill-green  { background: rgba(16,185,129,0.15); color: #10b981; }
.pill-blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.pill-gray   { background: rgba(100,116,139,0.15); color: #94a3b8; }
.pill-red    { background: rgba(239,68,68,0.15); color: #f87171; }

/* ─── Pagination ─────────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

.pag-buttons { display: flex; gap: 0.4rem; }

.pag-btn {
    padding: 0.4rem 0.8rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
}

.pag-btn:hover:not(:disabled) { background: var(--glass-hover); color: var(--text-primary); }
.pag-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pag-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Meeting Name Column ────────────────────────────────────────────────────── */
.meeting-name {
    font-weight: 500;
    color: var(--text-primary);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meeting-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    direction: ltr;
    text-align: right;
}

/* ─── Detail Page ─────────────────────────────────────────────────────────────── */
.detail-header {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.detail-header::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 200px; height: 200px;
    background: var(--gradient-primary);
    opacity: 0.05;
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.detail-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
.detail-url   { font-size: 0.85rem; color: var(--text-muted); direction: ltr; }

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
}

.detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-meta-item .meta-label { font-size: 0.72rem; color: var(--text-muted); }
.detail-meta-item .meta-value { font-size: 0.9rem; font-weight: 600; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* ─── Skeleton Loader ─────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-row td { padding: 0.85rem 1.1rem; }
.skeleton-cell { height: 16px; border-radius: 4px; }

/* ─── Loading Spinner ─────────────────────────────────────────────────────────── */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

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

.loading-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ─── Empty State ─────────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h4 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.4rem; }
.empty-state p  { font-size: 0.85rem; }

/* ─── Error State ─────────────────────────────────────────────────────────────── */
.error-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.error-state .error-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.error-state h4 { color: #f87171; margin-bottom: 0.4rem; }
.error-state p  { font-size: 0.82rem; }

/* ─── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
    direction: rtl;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(99,102,241,0.08);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-control::placeholder { color: var(--text-muted); }

.input-wrapper { position: relative; }

.toggle-pass {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0.2rem;
    line-height: 1;
    transition: var(--transition);
}

.toggle-pass:hover { color: var(--text-primary); }

/* ─── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.btn-primary:hover { box-shadow: 0 6px 20px rgba(99,102,241,0.5); transform: translateY(-1px); }

.btn-secondary {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.btn-secondary:hover { background: var(--glass-hover); color: var(--text-primary); border-color: var(--accent); }

.btn-full { width: 100%; justify-content: center; padding: 0.8rem; }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

/* ─── Alerts ──────────────────────────────────────────────────────────────────── */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.25);
    color: #6ee7b7;
}

/* ─── Recordings List ─────────────────────────────────────────────────────────── */
.recording-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.recording-item:last-child { border-bottom: none; }
.recording-item:hover { background: var(--glass-hover); }
.recording-info .rec-name { font-size: 0.875rem; font-weight: 500; }
.recording-info .rec-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ─── Participants Table ──────────────────────────────────────────────────────── */
.participant-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(99,102,241,0.15);
    color: var(--accent);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ─── Back Button ─────────────────────────────────────────────────────────────── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.back-btn:hover { color: var(--accent); }

/* ─── Refresh Button ─────────────────────────────────────────────────────────── */
.btn-refresh {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.btn-refresh:hover { border-color: var(--accent); color: var(--accent); }

.refresh-icon { transition: transform 0.4s ease; }
.btn-refresh:hover .refresh-icon { transform: rotate(180deg); }

/* ─── Scrollbar ───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }
    .sidebar { display: none; }
    .main-content { margin-right: 0; }
    .page-content { padding: 1rem; }
    .detail-grid { grid-template-columns: 1fr; }
}

/* ─── Tooltip ─────────────────────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 50%;
    transform: translateX(50%);
    background: #1e293b;
    color: var(--text-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid var(--border-color);
    z-index: 900;
}
