/* Design System Tokens */
:root {
    --bg-main: #0B0F19;
    --bg-sidebar: #111827;
    --bg-card: #1F2937;
    --bg-input: #111827;
    --border-color: #374151;
    --border-focus: #3B82F6;
    
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --color-primary: #3B82F6;
    --color-primary-glow: rgba(59, 130, 246, 0.15);
    --color-accent: #8B5CF6;
    --color-accent-glow: rgba(139, 92, 246, 0.15);
    
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.brand-logo {
    font-size: 24px;
}

.brand-name {
    font-size: 22px;
    background: linear-gradient(135deg, #60A5FA, #A78BFA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 36px;
    padding-left: 2px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--text-primary);
    background-color: var(--color-primary-glow);
    border-left: 3px solid var(--color-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.system-status-container {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: auto;
}

.system-status-container h3 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.status-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 12px;
}

.status-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-label {
    color: var(--text-secondary);
}

.status-indicator {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-indicator.online {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.status-indicator.offline {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

.status-indicator.unknown {
    background-color: rgba(107, 114, 128, 0.15);
    color: var(--text-secondary);
}

.active-gpu-mode {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.mode-label {
    color: var(--text-muted);
}

.mode-badge {
    background-color: var(--color-accent-glow);
    color: var(--color-accent);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Main Workspace Area */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top bar navigation */
.top-bar {
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
}

.top-bar h2 {
    font-size: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    background-color: var(--bg-card);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

/* Content Sections */
.content-body {
    padding: 40px;
    flex-grow: 1;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out forwards;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

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

.stat-icon {
    font-size: 32px;
    background-color: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

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

.stat-title {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 28px;
    margin-top: 4px;
    font-family: var(--font-heading);
}

/* Standard Panels */
.dashboard-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.panel-header {
    margin-bottom: 24px;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.panel-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

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

.btn-primary:hover {
    background-color: #2563EB;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

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

.btn-secondary:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-accent), #6D28D9);
    color: var(--text-primary);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.btn-accent:hover {
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
    transform: scale(1.02);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-social {
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-social.linkedin {
    background-color: #0077B5;
}

.btn-social.linkedin:hover {
    background-color: #006396;
    box-shadow: 0 0 12px rgba(0, 119, 181, 0.4);
}

.btn-social.instagram {
    background: linear-gradient(45deg, #F09433 0%, #E6683C 25%, #DC2743 50%, #CC2366 75%, #BC1888 100%);
}

.btn-social.instagram:hover {
    box-shadow: 0 0 12px rgba(220, 39, 67, 0.4);
    transform: scale(1.02);
}

.btn-clear {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
}

.btn-clear:hover {
    color: var(--text-primary);
    background-color: var(--color-danger);
    border-color: var(--color-danger);
}

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

.btn-danger:hover {
    background-color: #DC2626;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-group {
    display: flex;
    gap: 12px;
}

/* Console Grid */
.console-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.console-card {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.console-card h4 {
    font-size: 15px;
    margin-bottom: 8px;
    color: #F3F4F6;
}

.card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
    flex-grow: 1;
}

/* Log Screen Console */
.log-panel {
    padding: 20px;
}

.log-screen {
    background-color: #030712;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    padding: 16px;
    height: 250px;
    overflow-y: auto;
    border: 1px solid #1F2937;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-line {
    word-break: break-all;
    line-height: 1.4;
}

.log-line.system {
    color: #38BDF8;
}

.log-line.success {
    color: var(--color-success);
}

.log-line.error {
    color: var(--color-danger);
}

.log-line.info {
    color: var(--text-secondary);
}

/* Prompts Manager Configuration Styles */
.prompts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.campaign-card {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    position: relative;
    transition: border-color 0.2s ease;
}

.campaign-card:hover {
    border-color: var(--text-muted);
}

.campaign-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.campaign-num {
    background-color: var(--bg-input);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

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

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .form-group.full-width {
        grid-column: span 1;
    }
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-field {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-field:focus {
    border-color: var(--border-focus);
}

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

/* Gallery Grid Styles */
.gallery-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    background-color: rgba(0,0,0,0.1);
    padding: 12px;
    border-radius: 8px;
}

.filter-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    color: var(--text-primary);
}

.filter-tag.active {
    background-color: var(--color-primary);
    color: var(--text-primary);
    border-color: var(--color-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.gallery-item {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    border-color: var(--text-muted);
}

.gallery-img-wrapper {
    position: relative;
    padding-top: 100%; /* square 1:1 */
    background-color: #000;
}

.gallery-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-tag-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.gallery-btn-view {
    text-align: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    text-decoration: none;
    color: var(--text-primary);
    margin-top: 8px;
    transition: background-color 0.2s;
}

.gallery-btn-view:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Timeline/Posted Section Styles */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 8px var(--color-primary);
}

.timeline-content {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 20px;
}

@media (max-width: 576px) {
    .timeline-content {
        grid-template-columns: 1fr;
    }
}

.timeline-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-title {
    font-size: 16px;
    font-weight: 600;
}

.platform-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.platform-badge.linkedin {
    background-color: rgba(0, 119, 181, 0.15);
    color: #0077B5;
}

.platform-badge.instagram {
    background-color: rgba(220, 39, 67, 0.15);
    color: #DC2743;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
}

.timeline-caption {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-hashtags {
    font-size: 12px;
    color: var(--color-primary);
}

.timeline-img-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.timeline-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom Alert Dialog modal styling */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease forwards;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-title {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}
