/* Dashboard Specific Styles */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-2);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

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

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

.nav-icon {
    font-size: 1.1rem;
}

.sidebar-credits {
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.credits-label {
    font-size: 0.75rem;
    color: var(--text-3);
    margin-bottom: 0.25rem;
}

.credits-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: 0.75rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

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

.dash-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: var(--text-2);
    font-size: 0.9rem;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card.success {
    border-color: rgba(34, 197, 94, 0.3);
}

.stat-card.success::after {
    background: var(--success);
}

.stat-card.danger {
    border-color: rgba(239, 68, 68, 0.3);
}

.stat-card.danger::after {
    background: var(--danger);
}

.stat-card.purple {
    border-color: rgba(147, 51, 234, 0.3);
}

.stat-card.purple::after {
    background: #9333ea;
}

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

.stat-info {
    flex: 1;
}

.stat-info .stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-info .stat-value.counter {
    font-variant-numeric: tabular-nums;
}

.stat-info .stat-label {
    font-size: 0.8rem;
    color: var(--text-2);
}

.stat-trend {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.stat-trend.up {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card,
.quick-actions-card {
    height: 340px;
}

/* Donut Chart */
.donut-chart-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 1rem;
}

.donut-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-percent {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--success);
}

.donut-label {
    font-size: 0.75rem;
    color: var(--text-3);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-2);
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.valid {
    background: var(--success);
}

.dot.invalid {
    background: var(--danger);
}

.dot.risky {
    background: var(--warning);
}

.dot.unknown {
    background: var(--text-3);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-2px);
}

.quick-action-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

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

.qa-icon {
    font-size: 1.5rem;
}

.qa-text {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Accuracy Meter */
.accuracy-meter {
    margin-bottom: 1rem;
}

.meter-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-2);
    margin-bottom: 0.4rem;
}

.meter-value {
    color: var(--success);
    font-weight: 600;
}

.meter-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 8px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 8px;
    transition: width 1s ease;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(34, 197, 94, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--success);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}


/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

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

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

.link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

.link:hover {
    text-decoration: underline;
}

.card-body {
    padding: 1.25rem;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.data-table th {
    color: var(--text-3);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
}

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

.data-table .empty {
    text-align: center;
    color: var(--text-3);
    padding: 2rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.completed {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.processing {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-badge.pending {
    background: var(--bg-input);
    color: var(--text-3);
}

.status-badge.failed {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.04);
}

.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
}

.drop-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-2);
}

.hint {
    font-size: 0.75rem;
    color: var(--text-3);
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--success-bg);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
}

.file-icon {
    font-size: 1.5rem;
}

.file-meta {
    flex: 1;
}

.file-meta span {
    display: block;
}

.file-meta span:first-child {
    font-weight: 500;
}

.file-meta span:last-child {
    font-size: 0.8rem;
    color: var(--text-2);
}

.btn-x {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border-radius: 50%;
    cursor: pointer;
}

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

/* Column Section */
.column-section {
    margin-bottom: 1.25rem;
}

.column-section label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-2);
    margin-bottom: 0.5rem;
}

.column-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.col-btn {
    padding: 0.4rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

/* Table Wrap */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.table-wrap .data-table td {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-col {
    background: rgba(99, 102, 241, 0.06);
    color: var(--accent-light);
}

/* Progress */
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-2);
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 8px;
    transition: width 0.3s;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Results Area */
.results-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.result-panel.valid {
    border-color: rgba(34, 197, 94, 0.25);
}

.result-panel.invalid {
    border-color: rgba(239, 68, 68, 0.25);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: var(--bg-card);
}

.result-panel.valid .panel-header {
    background: rgba(34, 197, 94, 0.06);
}

.result-panel.invalid .panel-header {
    background: rgba(239, 68, 68, 0.06);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.panel-count {
    padding: 0.15rem 0.45rem;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 10px;
    font-size: 0.75rem;
}

.result-panel.invalid .panel-count {
    background: var(--danger-bg);
    color: var(--danger);
}

.panel-actions {
    display: flex;
    gap: 0.4rem;
}

.btn-sm {
    padding: 0.35rem 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.panel-body {
    height: 180px;
    overflow-y: auto;
    padding: 0.5rem;
}

.empty-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-3);
    font-size: 0.85rem;
}

.email-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.55rem;
    margin-bottom: 0.25rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    animation: fadeIn 0.15s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.email-row.valid {
    border-left: 2px solid var(--success);
}

.email-row.invalid {
    border-left: 2px solid var(--danger);
}

.email-addr {
    flex: 1;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-reason {
    font-size: 0.65rem;
    color: var(--text-3);
    padding: 0.1rem 0.35rem;
    background: var(--bg);
    border-radius: 3px;
}

/* Done Area */
.done-area {
    text-align: center;
    margin-top: 1.5rem;
}

.done-message {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--success-bg);
    border: 1px solid var(--success);
    border-radius: var(--radius);
    color: var(--success);
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.done-icon {
    font-size: 1.25rem;
}

/* Settings */
.settings-form {
    max-width: 400px;
}

.settings-form .form-group {
    margin-bottom: 1rem;
}

.settings-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
}

.settings-form input:disabled {
    opacity: 0.6;
}

.usage-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.usage-stat:last-child {
    border-bottom: none;
}

.usage-stat span:last-child {
    font-weight: 600;
    color: var(--accent-light);
}

/* Sections */
.section {
    /* visible by default */
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        width: 200px;
        padding: 1rem;
    }

    .main-content {
        margin-left: 200px;
        padding: 1.5rem;
    }

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

@media (max-width: 700px) {
    .sidebar {
        display: none;
    }

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

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

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.pricing-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

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

.pricing-card.featured {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
}

.pricing-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.pricing-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pricing-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: 0.25rem;
}

.pricing-credits {
    color: var(--text-2);
    margin-bottom: 0.25rem;
}

.pricing-cpc {
    font-size: 0.75rem;
    color: var(--text-3);
}

/* API Key Display */
.key-display {
    font-family: monospace;
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-2);
}

.key-new {
    background: var(--success-bg);
    color: var(--success);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-family: monospace;
    word-break: break-all;
}

.key-warning {
    font-size: 0.75rem;
    color: var(--warning);
    margin-top: 0.5rem;
}

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