:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light: #ecf0f1;
    --dark: #34495e;
    --gray: #95a5a6;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

/* Terms and Conditions Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

.modal p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.modal .btn {
    display: block;
    width: 100%;
    margin-top: 20px;
}

.modal .btn i {
    margin-right: 8px;
}

header {
    background: var(--primary);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.logo {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--secondary);
}

.content {
    padding: 25px;
}

.section {
    margin-bottom: 30px;
    display: none;
}

.active {
    display: block;
}

.upload-section {
    text-align: center;
}

.upload-area {
    border: 3px dashed var(--secondary);
    border-radius: 12px;
    padding: 40px 20px;
    margin: 20px 0;
    background: rgba(52, 152, 219, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #2980b9;
}

.upload-area i {
    font-size: 3.5rem;
    color: var(--secondary);
    margin-bottom: 15px;
}

.upload-area h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.upload-area p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.btn {
    display: inline-block;
    background: var(--secondary);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin: 10px 5px;
    width: 100%;
    max-width: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn:disabled {
    background: var(--gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.btn-warning {
    background: var(--warning);
}

.btn-warning:hover {
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.preview-container {
    margin: 20px auto;
    max-width: 400px;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
}

.loading {
    text-align: center;
    padding: 40px 0;
    display: none;
}

.spinner {
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-top: 5px solid var(--secondary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-section {
    text-align: center;
}

.signal-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--secondary);
}

.signal-card.buy {
    border-left-color: var(--success);
}

.signal-card.sell {
    border-left-color: var(--danger);
}

.signal-card.wait {
    border-left-color: var(--warning);
}

.signal-type {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.buy .signal-type {
    color: var(--success);
}

.sell .signal-type {
    color: var(--danger);
}

.wait .signal-type {
    color: var(--warning);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.result-item {
    background: rgba(236, 240, 241, 0.7);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.result-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.confidence-high {
    color: var(--success);
}

.confidence-medium {
    color: var(--warning);
}

.confidence-low {
    color: var(--danger);
}

.reasoning {
    background: rgba(52, 152, 219, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
}

.reasoning h4 {
    margin-bottom: 10px;
    color: var(--dark);
}

.pattern {
    display: inline-block;
    background: rgba(52, 152, 219, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.history-section {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: rgba(236, 240, 241, 0.7);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-signal {
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.history-buy {
    background: rgba(39, 174, 96, 0.2);
    color: var(--success);
}

.history-sell {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

.history-wait {
    background: rgba(243, 156, 18, 0.2);
    color: var(--warning);
}

.disclaimer {
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--danger);
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
    font-size: 0.85rem;
}

.disclaimer h4 {
    color: var(--danger);
    margin-bottom: 8px;
}

.api-status {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-active {
    background: var(--success);
}

.status-inactive {
    background: var(--danger);
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid #eee;
}

.copyright {
    margin-top: 10px;
    font-size: 0.8rem;
}

@media (max-width: 600px) {
    .container {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    
    .content {
        padding: 15px;
    }
    
    .btn {
        max-width: 100%;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}