/* ===== Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-hover: #22222e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #2a2a3a;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* ===== Login Screen ===== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 100%);
}

.login-box {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 380px;
}

.login-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.login-box h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-box input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    font-family: inherit;
}

.login-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.login-box button {
    width: 100%;
    padding: 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.login-box button:hover {
    background: var(--accent-hover);
}

.login-box .error {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* ===== Dashboard Layout ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .logo {
    font-size: 1.5rem;
}

.sidebar-header .brand {
    font-weight: 600;
    font-size: 1.125rem;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-item .icon {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

.nav-divider {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 1rem 1.5rem 0.5rem;
    letter-spacing: 0.5px;
    font-weight: 600;
}

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

.update-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-right: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.header-title h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.header-actions {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* ===== Sections ===== */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

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

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

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Cards ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

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

.card-content {
    padding: 1.25rem;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent);
    color: white;
}

/* ===== Content Lists ===== */
.content-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.content-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.content-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.content-item-title {
    font-weight: 600;
}

.content-item-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-hover);
}

.content-item-badge.draft {
    background: var(--warning);
    color: black;
}

.content-item-badge.approved {
    background: var(--success);
}

.content-item-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ===== Trends Grid ===== */
.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.trend-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.2s;
}

.trend-card:hover {
    border-color: var(--accent);
}

.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.trend-title {
    font-weight: 600;
}

.trend-score {
    background: var(--success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.trend-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.trend-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Ideas Grid ===== */
.ideas-actions {
    margin-bottom: 1rem;
}

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

.idea-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.idea-category {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.idea-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.idea-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Buttons ===== */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-card);
}

.btn-approve {
    padding: 0.75rem 1.5rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-reject {
    padding: 0.75rem 1.5rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ===== Form Elements ===== */
.input-field,
.textarea-field,
.select-field {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.input-field:focus,
.textarea-field:focus,
.select-field:focus {
    outline: none;
    border-color: var(--accent);
}

.textarea-field {
    min-height: 120px;
    resize: vertical;
}

/* ===== Message Box ===== */
.message-box {
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
}

.message-box p {
    margin: 0;
    line-height: 1.7;
}

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

/* ===== Task List ===== */
.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
}

.task-text {
    flex: 1;
}

.task-text.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* ===== Video Type Badges ===== */
.video-type-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    min-width: 45px;
    text-align: center;
}

.video-type-badge.short {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.video-type-badge.long {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

/* ===== Platform Colors ===== */
.platform-youtube {
    border-right: 4px solid #ff0000;
    padding-right: 1rem;
}

.platform-tiktok {
    border-right: 4px solid #00f2ea;
    padding-right: 1rem;
}

.platform-instagram {
    border-right: 4px solid #e1306c;
    padding-right: 1rem;
}

.platform-twitter {
    border-right: 4px solid #1da1f2;
    padding-right: 1rem;
}

.platform-linkedin {
    border-right: 4px solid #0077b5;
    padding-right: 1rem;
}

.platform-snapchat {
    border-right: 4px solid #fffc00;
    padding-right: 1rem;
}

.stat-card.youtube { border-right: 3px solid #ff0000; }
.stat-card.tiktok { border-right: 3px solid #00f2ea; }
.stat-card.instagram { border-right: 3px solid #e1306c; }
.stat-card.twitter { border-right: 3px solid #1da1f2; }
.stat-card.linkedin { border-right: 3px solid #0077b5; }
.stat-card.snapchat { border-right: 3px solid #fffc00; }

/* ===== Filter Buttons ===== */
.ideas-filter,
.trends-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

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

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ===== Analytics Tabs ===== */
.analytics-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.analytics-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.analytics-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.analytics-item .platform-icon {
    font-size: 1.25rem;
}

.analytics-item .platform-name {
    flex: 1;
    color: var(--text-secondary);
}

.analytics-item .platform-count {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .sidebar-header,
    .sidebar-footer {
        display: none;
    }

    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }

    .nav-item {
        flex-direction: column;
        padding: 0.5rem 1rem;
        gap: 0.25rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .nav-item span:not(.icon) {
        display: none;
    }

    .main-content {
        margin-right: 0;
        margin-bottom: 60px;
    }

    .content {
        padding: 1rem;
    }

    .header {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Toast animations */
@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(0); opacity: 1; }
    to { transform: translateX(-50%) translateY(-100%); opacity: 0; }
}


/* ==========================================
   UTM GENERATOR STYLES
   ========================================== */

.utm-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.utm-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-group .hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.utm-result {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.generated-link {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}

.generated-link code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--accent);
    word-break: break-all;
}

.utm-actions {
    display: flex;
    gap: 12px;
}

.success-message {
    color: #10b981;
    font-weight: 500;
    text-align: center;
}

.utm-guide ol {
    color: var(--text-secondary);
}

.utm-examples {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.example-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
}

.example-item .example-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.example-item code {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    word-break: break-all;
}
