/**
 * PostPro Main Stylesheet
 * Additional styles beyond the design system
 */

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-secondary) 100%);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.auth-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.auth-logo-icon {
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.auth-body {
    padding: 2rem;
}

.auth-footer {
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Dashboard Specific
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Project Cards
   ============================================ */
.project-card {
    position: relative;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}

.project-icon {
    width: 48px;
    height: 48px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-info h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
}

.project-url {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.project-stat {
    text-align: center;
}

.project-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.project-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Batch Upload Wizard
   ============================================ */
.wizard {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.wizard-step.active {
    color: var(--color-primary);
}

.wizard-step.completed {
    color: var(--color-success);
}

.wizard-number {
    width: 32px;
    height: 32px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.wizard-step.active .wizard-number {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.wizard-step.completed .wizard-number {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.wizard-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
}

/* ============================================
   File Upload
   ============================================ */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.file-upload.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
}

.file-upload-text {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.file-upload-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   Post Status Colors
   ============================================ */
.status-generating {
    color: var(--color-info);
}

.status-pending_review {
    color: var(--color-warning);
}

.status-approved {
    color: var(--color-success);
}

.status-published {
    color: var(--color-success);
}

.status-failed {
    color: var(--color-error);
}

/* ============================================
   Post Preview
   ============================================ */
.post-preview {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.post-preview h2 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    color: var(--color-primary);
}

.post-preview p {
    margin: 1rem 0;
    line-height: 1.7;
}

.post-preview ul,
.post-preview ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.post-preview li {
    margin: 0.5rem 0;
}

/* ============================================
   Artifacts Accordion
   ============================================ */
.artifact {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.artifact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: var(--bg-secondary);
}

.artifact-header:hover {
    background: var(--border-color);
}

.artifact-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.artifact-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.artifact-body {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: none;
}

.artifact.open .artifact-body {
    display: block;
}

/* ============================================
   Charts Container
   ============================================ */
.chart-container {
    position: relative;
    height: 300px;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    margin-bottom: 1.5rem;
}

/* ============================================
   Code Preview
   ============================================ */
.code-preview {
    background: var(--color-gray-900);
    color: var(--color-gray-100);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.8125rem;
    overflow-x: auto;
}

/* ============================================
   Theme Toggle
   ============================================ */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-toggle-track {
    width: 44px;
    height: 24px;
    background: var(--color-gray-600);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--transition-fast);
}

.theme-toggle-track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-fast);
}

[data-theme="dark"] .theme-toggle-track {
    background: var(--color-primary);
}

[data-theme="dark"] .theme-toggle-track::after {
    transform: translateX(20px);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

    .sidebar,
    .btn,
    .theme-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }
}