/* AutoSEO Stylesheet */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --bg-dark: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

/* ===== Sidebar ===== */
.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}

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

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

.nav-icon {
    font-size: 18px;
    margin-right: 12px;
}

.nav-label {
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 20px 32px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

.page-content {
    flex: 1;
    padding: 32px;
}

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ===== Cards ===== */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.card-body {
    color: var(--text);
}

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

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.stat-change {
    font-size: 13px;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--error);
}

/* ===== Tables ===== */
.table-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-dark);
}

th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

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

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

.btn-success:hover {
    background: #059669;
}

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

.btn-error:hover {
    background: #dc2626;
}

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

.btn-secondary:hover {
    background: #475569;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

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

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* ===== Ticket Cards ===== */
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.ticket-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ticket-number {
    font-weight: 600;
    color: var(--primary);
}

.ticket-url {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.ticket-comparison {
    margin: 16px 0;
}

.comparison-section {
    margin-bottom: 12px;
}

.comparison-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.comparison-value {
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 13px;
}

.comparison-value.new {
    background: #dbeafe;
    border-left: 3px solid var(--primary);
}

.ticket-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* ===== Utilities ===== */
.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

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

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.flex {
    display: flex;
}

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

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-nav {
        display: flex;
        padding: 0;
    }

    .nav-item {
        flex: 1;
        justify-content: center;
        padding: 12px;
    }

    .nav-label {
        display: none;
    }

    .page-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .ticket-grid {
        grid-template-columns: 1fr;
    }
}
