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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1a202c;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.guide-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1e293b;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 i {
    color: #4f46e5;
    margin-right: 12px;
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.status {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status.online {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #16a34a;
    color: #15803d;
    font-weight: 600;
}

.status.offline {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border: 1px solid #dc2626;
    color: #b91c1c;
    font-weight: 600;
}

.pairs-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

.controls {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-left: auto;
}

.settings label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.settings input,
.settings select {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.settings input:focus,
.settings select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.signals-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

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

.signals-header h2 {
    font-size: 1.6rem;
    color: #d97706;
    font-weight: 700;
}

.signals-list {
    max-height: 400px;
    overflow-y: auto;
}

.no-signals {
    text-align: center;
    padding: 40px;
    opacity: 0.7;
}

.no-signals i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.signal-item {
    background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    border-left: 4px solid #f59e0b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.4);
}

.signal-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-left-color: #d97706;
}

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

.signal-pair {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1d4ed8;
}

.signal-time {
    font-size: 0.9rem;
    opacity: 0.8;
}

.initial-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 8px;
    display: inline-block;
}

.signal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

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

.signal-detail .label {
    opacity: 0.8;
}

.signal-detail .value {
    font-weight: 600;
}

.signal-detail .value.positive {
    color: #2ecc71;
}

.signal-detail .value.negative {
    color: #e74c3c;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 22px;
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

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

.stat-icon {
    font-size: 2rem;
    color: #f39c12;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(243, 156, 18, 0.2);
    border-radius: 50%;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 5px;
}

.log-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 22px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

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

.log-header h3 {
    color: #1e40af;
    font-weight: 600;
}

.log-output {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #334155;
}

.log-entry {
    margin-bottom: 5px;
    padding: 2px 0;
}

.log-entry.info {
    color: #1e40af;
}

.log-entry.success {
    color: #059669;
}

.log-entry.warning {
    color: #d97706;
}

.log-entry.error {
    color: #e74c3c;
    border-left: 3px solid #e74c3c;
}

.log-timestamp {
    color: #7f8c8d;
    font-size: 12px;
    margin-right: 8px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.modal-body {
    padding: 25px;
    line-height: 1.6;
}

.guide-section {
    margin-bottom: 30px;
}

.guide-section h3 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
}

.guide-section ul {
    list-style: none;
    padding-left: 0;
}

.guide-section li {
    background: #f8f9fa;
    margin: 8px 0;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.indicator-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #667eea;
}

.indicator-info h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.indicator-info p {
    color: #5a6c7d;
    margin: 10px 0;
    font-style: italic;
}

.indicator-info ul {
    margin: 10px 0 0 0;
}

.indicator-info li {
    background: white;
    border-left-color: #27ae60;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .settings {
        margin-left: 0;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .signal-details {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
}
