/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', Arial, sans-serif;
    background: linear-gradient(to bottom, hsla(224, 67%, 98%, 0.95), #5c53be);
    min-height: 100vh;
    color: #333;
    direction: rtl;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: minmax(300px, 350px) 1fr;
    gap: 30px;
    min-height: calc(100vh - 200px);
}

/* Header */
.header {
    background: linear-gradient(to bottom, #5c53be, hsla(224, 67%, 98%, 0.95));
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    margin-bottom: 20px;

}


.header .container {
    grid-template-columns: 1fr;
    text-align: right;
    padding: 0 20px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: right;
    padding: 0 20px;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4338ca;
    margin-bottom: 5px;
}

.logo-image {
    width: 50px;
    height: 50px;
    margin-left: 5px;
    vertical-align: middle;
}

.subtitle {
    font-size: 1.3rem;
    color: #6b7280;
    font-weight: 500;
    margin-right: 170px;
}

/* Sidebar */
.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.coin-selector h3 {
    color: #4338ca;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.coin-dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.coin-dropdown:focus {
    outline: none;
    border-color: #4338ca;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px 0;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 56, 202, 0.3);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

/* Coin Info */
.coin-info {
    background: #f8fafc;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #e2e8f0;
}

.coin-info h4 {
    color: #4338ca;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-item:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: #64748b;
}

.value {
    font-weight: 700;
    color: #1e293b;
}

.value.price {
    color: #059669;
    font-size: 1.1rem;
}

.value.change.positive {
    color: #059669;
}

.value.change.negative {
    color: #dc2626;
}

/* Analysis Buttons */
.analysis-buttons {
    margin: 25px 0;
}

/* Cache Section */
.cache-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.cache-section h4 {
    color: #4338ca;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: 600px;
    margin-bottom: 0;
}

/* Welcome Screen */
.welcome {
    text-align: center;
    padding: 40px 20px;
}

.welcome-content h2 {
    color: #4338ca;
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.welcome-content p {
    color: #6b7280;
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature {
    background: #f8fafc;
    padding: 30px 20px;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    border-color: #4338ca;
}

.feature h3 {
    color: #4338ca;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature p {
    color: #64748b;
    line-height: 1.6;
}

/* Loading Screen */
.loading {
    text-align: center;
    padding: 80px 20px;
}

.loader {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f4f6;
    border-top: 6px solid #4338ca;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

/* مؤشر الخوف والطمع */
.fear-extreme { color: #8B0000; } /* أحمر داكن */
.fear { color: #FF6B6B; }        /* أحمر فاتح */
.neutral { color: #e79a27; }     /* أصفر */
.greed { color: #6BCF7F; }       /* أخضر فاتح */
.greed-extreme { color: #4ECDC4; } /* أخضر داكن */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #6b7280;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Analysis Results */
.analysis-results {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Signal Strength */
.signal-strength {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
}

.signal-strength h3 {
    color: #4338ca;
    margin-bottom: 20px;
    font-size: 1.4rem;
    text-align: right;
    
}

.strength-meter {
    /* التعديلات الجديدة هنا */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    /* تأكد من أن الارتفاع مناسب للمحتوى */
    height: 60px; /* يمكن زيادة الارتفاع حسب الحاجة */
    position: relative; /* مهم ليعمل الـposition: absolute للعناصر بداخله */
    background: #e5e7eb;
    border-radius: 15px;
    margin: 20px 0;
}
.strength-bar {
    height: 100%;
    border-radius: 15px;
    transition: all 0.5s ease;
    position: absolute; /* التعديل هنا */
    background: linear-gradient(90deg, #dc2626, #f59e0b, #10b981);
    z-index: 1;
    width: 50%;
}
.strength-score {
    /* التعديلات الجديدة هنا */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2; /* تأكد أن القيمة أعلى من الشريط */
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.recommendation {
    margin-top: 15px;
}

.rec-text {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
}

.rec-text.buy { background: #dcfce7; color: #166534; }
.rec-text.sell { background: #fef2f2; color: #991b1b; }
.rec-text.neutral { background: #fef3c7; color: #92400e; }

/* Summary and Analysis Sections */
.summary-section, .analysis-section {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #e2e8f0;
}

.summary-section h3, .analysis-section h3 {
    color: #4338ca;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.summary-content, .analysis-content {
    line-height: 1.8;
    color: #374151;
}

/* Signals Breakdown */
.signals-breakdown {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e2e8f0;
}

.signals-breakdown h3 {
    color: #4338ca;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.signals-content {
    display: grid;
    gap: 15px;
}

.signal-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease;
}

.signal-item:hover {
    transform: translateY(-2px);
    border-color: #4338ca;
}

.signal-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}

.signal-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-value {
    font-weight: 700;
    font-size: 1.2rem;
    min-width: 50px;
    text-align: center;
}

.score-strong { color: #059669; }
.score-weak { color: #dc2626; }
.score-neutral { color: #f59e0b; }

.signal-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    color: #991b1b;
}

.error-message h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Footer */
.footer {
    background: linear-gradient(to bottom, #5c53be, hsla(224, 67%, 98%, 0.95));
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 10px 20px;
    margin-top: 0;
    border-top: 0;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.footer a {
    color: #4338ca;
    text-decoration: none;
    font-weight: bold;
}

.footer a:hover {
    color: #6366f1;
    text-decoration: underline;
}

.footer p {
    color: #6b7280;
    margin-bottom: 10px;
}

.disclaimer {
    font-size: 0.9rem;
    color: #f59e0b !important;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .sidebar {
        position: static;
        order: 1;
    }
    
    .main-content {
        order: 2;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 1.8rem;
    }
    
    .logo-image {
        width: 40px;
        height: 40px;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-right: 0;
        text-align: center;
    }
    
    .welcome-content h2 {
        font-size: 1.6rem;
    }
    
    .welcome-content p {
        font-size: 1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .header-container {
        text-align: center;
    }
    
    .signal-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .strength-meter {
        height: 50px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .label, .value {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header-container,
    .footer-container,
    .sidebar,
    .main-content {
        padding: 15px;
    }
    
    .logo {
        font-size: 1.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .logo-image {
        width: 35px;
        height: 35px;
        margin: 0;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
    
    .coin-dropdown {
        font-size: 0.95rem;
        padding: 10px;
    }
    
    .feature h3 {
        font-size: 1.1rem;
    }
    
    .signal-strength h3,
    .summary-section h3,
    .analysis-section h3 {
        font-size: 1.1rem;
    }
}

/* رسالة عدم وجود بيانات */
.no-data-message {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 2px solid #ffc107;
    border-radius: 15px;
    padding: 25px;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.warning-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #856404;
    margin-bottom: 10px;
}

.message-text {
    color: #6c5a00;
    line-height: 1.6;
    margin-bottom: 15px;
}

.message-hint {
    background: rgba(255, 255, 255, 0.5);
    padding: 10px 15px;
    border-radius: 8px;
    color: #4a3f00;
    font-size: 0.95rem;
}