* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1d35 50%, #0f1829 100%);
    color: #e8eaed;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* ========== HEADER ========== */
header {
    text-align: center;
    margin-bottom: 35px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

h1 {
    font-size: 2.8em;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    text-shadow: 0 0 40px rgba(59, 130, 246, 0.5);
    position: relative;
    z-index: 1;
}

.subtitle {
    color: #94a3b8;
    font-size: 1.1em;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.version-badge {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    font-size: 0.85em;
    color: #3b82f6;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* ========== CONTROL PANEL ========== */
.control-panel {
    margin-bottom: 35px;
}

.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 25px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    backdrop-filter: blur(10px);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    color: #94a3b8;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #e8eaed;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:hover {
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(15, 23, 42, 1);
}

.filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    padding: 18px 40px;
    font-size: 1.2em;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.3em;
}

.progress-info {
    margin-top: 25px;
    animation: fadeIn 0.4s ease;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 10px;
    margin: 0 auto 15px;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #0ea5e9 50%, #06b6d4 100%);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.8);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    color: #3b82f6;
    font-size: 1em;
    font-weight: 600;
    text-align: center;
}

/* ========== STATS PANEL ========== */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 35px;
    animation: fadeIn 0.5s ease;
}

.stat-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.stat-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    color: #94a3b8;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    color: #e8eaed;
    font-size: 2em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-primary { color: #3b82f6; }
.stat-info { color: #0ea5e9; }
.stat-success { color: #10b981; }
.stat-danger { color: #ef4444; }
.stat-warning { color: #f59e0b; }
.stat-time { color: #8b5cf6; }

/* ========== RESULTS SECTION ========== */
.results-section {
    margin-bottom: 35px;
    animation: fadeIn 0.5s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}
/* ========== ACTION CONTROLS (COPY & DOWNLOAD) ========== */
.action-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-action:hover::before {
    width: 200px;
    height: 200px;
}

.btn-action:active {
    transform: scale(0.95);
}

.btn-action .btn-icon {
    font-size: 1.1em;
}

.btn-copy {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-copy.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    animation: successPulse 0.6s ease;
}

.btn-download {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: #fff;
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.btn-download.downloading {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    animation: downloadPulse 0.8s ease;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes downloadPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .results-header {
        gap: 12px;
    }
    
    .action-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-action {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .action-controls {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
    }
}
.results-header h2 {
    color: #3b82f6;
    font-size: 1.8em;
    font-weight: 700;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-controls label {
    color: #94a3b8;
    font-size: 0.9em;
    font-weight: 600;
}

.sort-controls select {
    padding: 10px 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #e8eaed;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-controls select:hover {
    border-color: rgba(59, 130, 246, 0.6);
}

.table-container {
    background: rgba(30, 41, 59, 0.4);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

thead {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
}

th {
    padding: 16px 14px;
    text-align: left;
    color: #3b82f6;
    font-weight: 700;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    position: relative;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

th.sortable:hover {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
}

tbody tr {
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
    transform: scale(1.01);
}

tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.3);
}

tbody tr:nth-child(even):hover {
    background: rgba(59, 130, 246, 0.08);
}

td {
    padding: 14px;
    color: #e8eaed;
    font-size: 0.95em;
}

.symbol-cell {
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.05em;
    font-family: 'Monaco', 'Courier New', monospace;
}

.trend-bullish {
    color: #10b981;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.trend-bearish {
    color: #ef4444;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.structure-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.structure-bos {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.structure-choch {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.structure-bearish-bos {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.structure-bearish-choch {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.positive {
    color: #10b981;
    font-weight: 600;
}

.negative {
    color: #ef4444;
    font-weight: 600;
}

.neutral {
    color: #94a3b8;
}

.risk-low {
    color: #10b981;
}

.risk-medium {
    color: #f59e0b;
}

.risk-high {
    color: #ef4444;
}

.score-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: 700;
    min-width: 45px;
    text-align: center;
}

.score-excellent {
    background: rgba(16, 185, 129, 0.25);
    color: #10b981;
    border: 2px solid rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.score-good {
    background: rgba(59, 130, 246, 0.25);
    color: #3b82f6;
    border: 2px solid rgba(59, 130, 246, 0.5);
}

.score-fair {
    background: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
    border: 2px solid rgba(245, 158, 11, 0.5);
}

.score-poor {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
    border: 2px solid rgba(239, 68, 68, 0.5);
}

.timeframe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.timeframe-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 6px;
    font-size: 0.85em;
    color: #3b82f6;
    font-weight: 600;
    font-family: 'Monaco', 'Courier New', monospace;
}

.timeframe-tag-bearish {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #ef4444;
}

/* ========== LOG SECTION ========== */
.log-section {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 25px;
    max-height: 450px;
    overflow: hidden;
}

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

.log-header h3 {
    color: #3b82f6;
    font-size: 1.3em;
    font-weight: 700;
}

.btn-secondary {
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #3b82f6;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
}

.log-content {
    max-height: 350px;
    overflow-y: auto;
    font-family: 'Monaco', 'Courier New', 'Consolas', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

.log-entry {
    padding: 10px 12px;
    margin-bottom: 4px;
    border-left: 3px solid transparent;
    border-radius: 4px;
    animation: slideIn 0.3s ease;
    transition: all 0.2s ease;
}

.log-entry:hover {
    background: rgba(59, 130, 246, 0.05);
}

.log-success {
    color: #10b981;
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.log-error {
    color: #ef4444;
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.log-warning {
    color: #f59e0b;
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.log-info {
    color: #3b82f6;
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.hidden {
    display: none !important;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
    border: 2px solid rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1200px) {
    .filter-controls {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 0.95em;
    }
    
    .filter-controls {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    table {
        font-size: 0.85em;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-primary {
        font-size: 1em;
        padding: 15px 30px;
    }
}

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

    h1 {
        font-size: 1.6em;
    }
}
