/* الأنماط العامة - موقع محسوب */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a73e8;
    --secondary-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc04;
    --dark-color: #202124;
    --light-color: #f8f9fa;
    --border-color: #dadce0;
    --text-color: #3c4043;
    --text-primary: #3c4043;
    --text-secondary: #5f6368;
    --success-color: #0f9d58;
    --hover-bg: #f8f9fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    line-height: 1.7;
    color: var(--text-color);
    background-color: #f5f5f5;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.logo a {
    text-decoration: none;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.logo-image {
    height: 45px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.logo-image:hover {
    opacity: 0.8;
}

/* Navigation */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.main-nav .nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.main-nav .nav-menu li {
    position: relative;
}

.main-nav .nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 12px;
    display: block;
    white-space: nowrap;
}

.main-nav .nav-menu a:hover {
    color: var(--primary-color);
}

.main-nav .nav-menu a.active {
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
}

.main-nav .nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 12px;
    left: 12px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.dropdown.active .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    min-width: 220px;
    padding: 10px 0;
    z-index: 1001;
    margin-top: 5px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown.active .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
}

.dropdown-menu a:hover {
    background-color: var(--light-color);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    width: 36px;
    height: 36px;
    justify-content: center;
    align-items: center;
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2.5px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 400px);
    padding: 30px 0;
}

/* Search Section */
.search-section {
    text-align: center;
    padding: 30px 30px;
    background: linear-gradient(135deg, #1a73e8 0%, #34a853 100%);
    color: #fff;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.search-section p {
    font-size: 1.05rem;
    opacity: 0.95;
    margin-bottom: 20px;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    outline: none;
    transition: all 0.3s;
    text-align: center;
}

.search-input:focus {
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transform: translateY(-2px);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: right;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: rgba(26, 115, 232, 0.08);
}

.result-main {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.result-short-name {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
}

.result-symbol {
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 500;
}

.result-full-name {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

.search-loading,
.search-no-results,
.search-error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.search-error {
    color: var(--danger-color);
}

/* Features */
.features-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.feature-card {
    background: #fff;
    padding: 35px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.6rem;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 1.05rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    margin-top: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    transition: opacity 0.3s;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Update Notice Bar */
.update-notice {
    background-color: #fff3cd;
    color: #856404;
    padding: 8px 0;
    text-align: center;
    font-size: 0.85rem;
    border-bottom: 1px solid #ffc107;
    position: relative;
}

.update-notice .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.notice-icon {
    font-size: 1rem;
}

.notice-text {
    font-weight: 500;
}

.notice-text strong {
    font-weight: 700;
}

.notice-close {
    position: absolute;
    left: 20px;
    background: none;
    border: none;
    color: #856404;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.notice-close:hover {
    opacity: 1;
}

.update-notice.hidden {
    display: none;
}

/* Footer */
.main-footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.footer-section p {
    color: #ccc;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
}

.social-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: all 0.3s;
}

.social-links a:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}

.social-x svg {
    width: 22px;
    height: 22px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #444;
}

.footer-bottom p {
    margin: 8px 0;
}

.disclaimer {
    font-size: 0.9rem;
    color: #999;
    margin-top: 10px;
}

/* Market Section */
.market-section,
.dividends-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.section-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.view-more-link {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.view-more-link:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.market-section h2,
.dividends-section h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 2rem;
    font-weight: 600;
}

/* Market Tabs Container */
.market-tabs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Market Tabs */
.market-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    padding: 12px 30px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-button {
    padding: 10px 20px;
    background: var(--light-color);
    border: 2px solid transparent;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.category-button:hover {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
}

.category-button.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Market Data Container */
.market-data-container {
    position: relative;
    min-height: 400px;
}

.category-content {
    display: none;
}

.category-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stock Table */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
}

.stock-table thead {
    background: rgba(26, 115, 232, 0.05);
}

.stock-table th {
    padding: 14px 10px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.stock-table td {
    padding: 14px 10px;
    text-align: center;
    font-size: 1rem;
    border-bottom: 1px solid #e8e8e8;
}

.stock-table tbody tr {
    transition: background-color 0.2s;
}

.stock-table tbody tr:hover {
    background-color: rgba(26, 115, 232, 0.03);
}

.stock-symbol {
    font-weight: 600;
    color: var(--primary-color);
}

.stock-name {
    color: #666;
    font-size: 0.95rem;
}

.company-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.company-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.change-positive {
    color: var(--success-color);
    font-weight: 600;
}

.change-negative {
    color: var(--danger-color);
    font-weight: 600;
}

.change-neutral {
    color: #666;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    position: relative;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
    position: absolute;
    margin-left: 2px;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state p {
    margin: 0;
}



.dividend-yield-positive {
    color: var(--success-color);
    font-weight: 600;
}

.dividend-amount {
    font-weight: 600;
    color: var(--primary-color);
}


/* Market Movement Page */
.market-movement-page {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.page-title {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 25px;
    text-align: center;
}

.market-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.period-selector {
    min-width: 200px;
}

.period-select {
    width: 100%;
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s;
}

.period-select:hover {
    border-color: var(--primary-color);
}

.period-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.market-content {
    min-height: 400px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: slideDown 0.3s;
    position: relative;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    color: #999;
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--danger-color);
}

#modal-title {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.5rem;
    padding-left: 40px;
}

.modal-body {
    min-height: 150px;
}

.stock-range-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.range-item {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.range-item.highest {
    background: linear-gradient(135deg, rgba(15, 157, 88, 0.1) 0%, rgba(15, 157, 88, 0.05) 100%);
    border: 2px solid rgba(15, 157, 88, 0.3);
}

.range-item.lowest {
    background: linear-gradient(135deg, rgba(234, 67, 53, 0.1) 0%, rgba(234, 67, 53, 0.05) 100%);
    border: 2px solid rgba(234, 67, 53, 0.3);
}

.range-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.range-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.range-item.highest .range-value {
    color: var(--success-color);
}

.range-item.lowest .range-value {
    color: var(--danger-color);
}

.range-date {
    font-size: 0.85rem;
    color: #999;
}

.range-actions {
    text-align: center;
    margin-top: 10px;
}

.btn-primary {
    padding: 12px 30px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

/* Company Page */
.company-header {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.company-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.company-title h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
}

.company-symbol {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(26, 115, 232, 0.1);
    padding: 5px 15px;
    border-radius: 6px;
}

.company-full-name {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 15px;
}

.company-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.company-exchange,
.company-sector {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.company-exchange {
    background: rgba(52, 168, 83, 0.1);
    color: var(--secondary-color);
    font-weight: 600;
}

.company-sector {
    background: var(--light-color);
    color: #666;
}

.company-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.coming-soon {
    color: #999;
    font-size: 1.1rem;
}

/* Desktop Enhancements */
@media (min-width: 1024px) {
    body {
        font-size: 17px;
    }
    
    .stock-table th {
        font-size: 1.05rem;
        padding: 16px 12px;
    }
    
    .stock-table td {
        font-size: 1.05rem;
        padding: 16px 12px;
    }
    
    .stock-name {
        font-size: 1rem;
    }
    
    .search-section p {
        font-size: 1.15rem;
    }
    
    .search-input {
        font-size: 1.15rem;
        padding: 18px 24px;
    }
    
    .market-section h2,
    .dividends-section h2 {
        font-size: 2.2rem;
    }
    
    .feature-card h3 {
        font-size: 1.7rem;
    }
    
    .feature-card p {
        font-size: 1.1rem;
    }
}


/* صفحة توزيعات الأرباح */
.dividends-page {
    padding: 2rem 0;
}

.page-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.dividends-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.dividends-controls .market-tabs {
    display: flex;
    gap: 0.5rem;
}

.dividends-controls .market-tabs .tab-btn {
    padding: 0.75rem 2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dividends-controls .market-tabs .tab-btn:hover {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.05);
}

.dividends-controls .market-tabs .tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.year-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.year-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.year-btn:hover {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.05);
}

.year-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.dividends-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dividends-table {
    width: 100%;
    border-collapse: collapse;
}

.dividends-table thead {
    background: var(--primary-color);
    color: white;
}

.dividends-table th {
    padding: 1rem;
    text-align: right;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.dividends-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dividends-table th .sort-icon {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.6;
}

.dividends-table th .sort-icon.active {
    opacity: 1;
    font-weight: bold;
}

.dividends-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.dividends-table tbody tr:hover {
    background: var(--hover-bg);
}

.dividends-table td {
    padding: 1rem;
    text-align: right;
}

.dividends-table .positive {
    color: var(--success-color);
    font-weight: 600;
}

.dividends-table .negative {
    color: var(--danger-color);
    font-weight: 600;
}


/* حاسبة الاستثمار */
.calculator-page {
    padding: 2rem 0;
}

.page-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.calculator-container {
    max-width: 1200px;
    margin: 0 auto;
}

.calculator-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-left: 0.5rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: normal;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.stock-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--hover-bg);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.results-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-item {
    padding: 1.5rem;
    background: var(--hover-bg);
    border-radius: 8px;
    text-align: center;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.table-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
}

.investment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.investment-table thead {
    background: var(--primary-color);
    color: white;
}

.investment-table th {
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
}

.investment-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.investment-table tbody tr:hover {
    background: var(--hover-bg);
}

.investment-table td {
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.investment-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.investment-table tbody tr:nth-child(even):hover {
    background: var(--hover-bg);
}

/* أكاديمية محسوب */
.academy-hero {
    text-align: center;
    padding: 30px 30px;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    margin-bottom: 40px;
    border-radius: 12px;
}

.hero-title {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.hero-description {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    font-size: 1rem;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
}

.search-btn {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #0056b3;
}

.categories-section {
    margin-bottom: 2rem;
    margin-top: 1rem;
}

.section-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.category-card {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-card h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0;
    font-weight: 600;
}

.terms-section {
    margin-bottom: 1rem;
}

.terms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
}

.terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.term-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.term-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.term-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.term-category-small {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--primary-color);
    background: rgba(26, 115, 232, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    text-align: left;
}

.term-title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.term-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.term-title a:hover {
    color: var(--primary-color);
}

.term-definition {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.term-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #0056b3;
}

.term-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.load-more-container {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

/* صفحة تفاصيل المصطلح */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb .separator {
    color: var(--text-secondary);
}

.breadcrumb .current {
    color: var(--text-secondary);
}

.term-article {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.term-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.term-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.term-header .term-category {
    flex-shrink: 0;
}

.term-header .term-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
    flex: 1;
}

.term-content section {
    margin-bottom: 2rem;
}

.term-content h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.definition-text,
.example-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.example-section {
    background: var(--hover-bg);
    padding: 1.5rem;
    border-radius: 8px;
}



.related-terms {
    margin-bottom: 3rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.loading,
.no-results,
.error {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.error {
    color: var(--danger-color);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}
/* حاسبة متوسط التكلفة */
.calculator-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calculator-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.calculator-tabs .tab-btn {
    padding: 1rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 200px;
    text-align: center;
}

.calculator-tabs .tab-btn:hover {
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.05);
    transform: translateY(-2px);
}

.calculator-tabs .tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.tab-content {
    width: 100%;
    min-height: 400px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.calculator-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.calculator-table thead {
    background: var(--primary-color);
    color: white;
}

.calculator-table th,
.calculator-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.calculator-table tbody tr:hover {
    background: var(--hover-bg);
}

.calculator-table .total-row {
    background: #e3f2fd;
    font-weight: bold;
}

.btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.form-control[readonly] {
    background: var(--hover-bg);
    color: var(--text-secondary);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/* ===================================
   صفحة التوصيات
   =================================== */

.recommendations-hero {
    text-align: center;
    padding: 30px 30px;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    margin-bottom: 40px;
    border-radius: 12px;
}

.recommendations-section {
    margin-bottom: 40px;
}

.recommendations-content {
    margin-top: 20px;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.recommendation-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

.recommendation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.card-header {
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #dee2e6;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.company-info {
    flex: 1;
    min-width: 0;
}

.company-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0;
}

.company-symbol {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    flex-shrink: 0;
}

.recommendation-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-body {
    padding: 20px;
}

.price-info {
    margin-bottom: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.section-title {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    text-align: center;
    flex: 1;
}

.section-title-simple {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    text-align: center;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.firm-name-inline {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
}

.firm-name-inline svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.analyst-name-inline {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 80px;
    text-align: left;
}

.recommendation-meta {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 12px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.recommendation-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 6px;
    flex: 1;
    min-width: 140px;
    justify-content: flex-start;
}

.recommendation-meta .meta-item svg {
    color: var(--primary-color);
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

.price-row.highlight {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-top: 8px;
}

.price-row .label {
    color: #666;
}

.price-row .value {
    font-weight: 600;
    color: #333;
}

.current-price-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
}

.current-price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

.current-price-row.highlight {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 6px;
    margin-top: 8px;
}

.meta-info {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
}

.meta-item svg {
    color: #999;
}

.result-badge {
    display: block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.result-badge.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.result-badge.failed {
    background: #ffebee;
    color: #c62828;
}

.result-badge.neutral {
    background: #fff3e0;
    color: #f57c00;
}

.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.report-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.report-link:hover {
    color: var(--secondary-color);
}

.load-more-container {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.btn-load-more {
    padding: 15px 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.btn-load-more:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.4);
}

.btn-load-more:active {
    transform: translateY(0);
}

.report-link svg {
    width: 16px;
    height: 16px;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    color: #666;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .search-group {
        grid-column: span 1;
    }
    
    .recommendations-stats {
        grid-template-columns: 1fr;
    }
    
    .recommendations-hero {
        padding: 25px 20px;
        margin-bottom: 30px;
    }
    
    .card-header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 15px;
    }
    
    .company-info {
        flex: 0 1 auto;
        min-width: 0;
    }
    
    .company-name {
        font-size: 1rem;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .company-symbol {
        font-size: 0.75rem;
        text-align: center;
        white-space: nowrap;
    }
    
    .recommendation-badge {
        padding: 6px 10px;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
}