/* ============================================
   TextSight.ai - Dashboard Styles
   ============================================ */

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--space-6);
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-main {
    min-width: 0;
}

.dashboard-results {
    min-width: 0;
}

/* ============================================
   SCAN CARD
   ============================================ */
.scan-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    min-height: 500px;
}

.scan-card .card-header {
    flex-shrink: 0;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
}

/* ============================================
   INPUT TABS
   ============================================ */
.input-tabs {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.input-tab {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.input-tab svg {
    width: 18px;
    height: 18px;
}

.input-tab:hover {
    color: var(--text-primary);
    background-color: var(--gray-100);
}

.input-tab.active {
    color: var(--primary);
    background-color: var(--primary-100);
    border-color: var(--primary-200);
}

/* ============================================
   TAB CONTENT
   ============================================ */
.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-4) 0;
    overflow: hidden;
}

.tab-panel {
    display: none;
    flex: 1;
    flex-direction: column;
}

.tab-panel.active {
    display: flex;
}

/* ============================================
   TEXT INPUT
   ============================================ */
.text-input {
    flex: 1;
    width: 100%;
    min-height: 300px;
    padding: var(--space-4);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    resize: none;
    transition: all var(--transition-fast);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.text-input::placeholder {
    color: var(--text-tertiary);
}

/* ============================================
   FILE UPLOAD
   ============================================ */
.file-upload-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: var(--space-8);
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: var(--primary);
    background-color: var(--primary-50);
}

.file-upload-content {
    text-align: center;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-4);
    color: var(--text-tertiary);
}

.file-upload-zone:hover .file-upload-icon,
.file-upload-zone.drag-over .file-upload-icon {
    color: var(--primary);
}

.file-upload-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.file-upload-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
}

.file-upload-formats {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background-color: var(--success-50);
    border: 1px solid var(--success-100);
    border-radius: var(--radius-lg);
    margin-top: var(--space-4);
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.file-info svg {
    width: 32px;
    height: 32px;
    color: var(--success);
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.file-remove:hover {
    color: var(--error);
    background-color: var(--error-50);
}

.file-remove svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   URL INPUT
   ============================================ */
.url-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.url-input-wrapper:focus-within {
    border-color: var(--primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.url-input-icon {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.url-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.url-input::placeholder {
    color: var(--text-tertiary);
}

.url-fetch-btn {
    padding: var(--space-2) var(--space-4);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-inverse);
    background-color: var(--primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.url-fetch-btn:hover {
    background-color: var(--primary-hover);
}

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

.url-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: var(--space-3);
}

/* ============================================
   SCAN FOOTER
   ============================================ */
.scan-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.word-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.word-count .separator {
    margin: 0 var(--space-2);
    color: var(--text-tertiary);
}

.btn-scan {
    min-width: 150px;
}

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

.btn-scan svg {
    width: 18px;
    height: 18px;
}

/* Scanning State */
.btn-scan.scanning {
    pointer-events: none;
}

.btn-scan.scanning svg {
    animation: spin 1s linear infinite;
}

/* ============================================
   RESULTS PANEL
   ============================================ */
.results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 140px);
    min-height: 400px;
    padding: var(--space-8);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    text-align: center;
}

.results-placeholder-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-4);
    color: var(--text-tertiary);
}

.results-placeholder-icon svg {
    width: 100%;
    height: 100%;
}

.results-placeholder-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.results-placeholder-text {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 280px;
    line-height: 1.6;
}

/* Results Container (when results are shown) */
.results-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    height: calc(100vh - 140px);
    min-height: 400px;
    overflow-y: auto;
}

/* Score Cards */
.score-card {
    padding: var(--space-5);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.score-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

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

.score-card-info {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    cursor: help;
}

/* Circular Gauge */
.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge {
    position: relative;
    width: 120px;
    height: 120px;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 10;
}

.gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

.gauge-fill.success {
    stroke: var(--success);
}

.gauge-fill.warning {
    stroke: var(--warning);
}

.gauge-fill.error {
    stroke: var(--error);
}

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

.gauge-score {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.gauge-score.success {
    color: var(--success);
}

.gauge-score.warning {
    color: var(--warning);
}

.gauge-score.error {
    color: var(--error);
}

.gauge-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.gauge-description {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: var(--space-3);
}

/* Pro Feature Card */
.pro-card {
    background-color: var(--gray-50);
    border: 1px solid var(--border-light);
}

.pro-card-badge {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background-color: var(--primary-100);
    border-radius: var(--radius-full);
}

.pro-card-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* Export Button */
.btn-export {
    width: 100%;
    justify-content: center;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1279px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .dashboard-results {
        order: -1;
    }
    
    .results-placeholder,
    .results-container {
        height: auto;
        min-height: auto;
    }
    
    .scan-card {
        height: auto;
        min-height: 400px;
    }
}

@media (max-width: 767px) {
    .scan-footer {
        flex-direction: column;
        gap: var(--space-4);
        align-items: stretch;
    }
    
    .word-count {
        text-align: center;
    }
    
    .btn-scan {
        width: 100%;
    }
    
    .input-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--space-2);
    }
    
    .input-tab {
        white-space: nowrap;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-container {
    animation: fadeIn 0.3s ease-out;
}
