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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #7c3aed;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --beacon-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #06b6d4 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: var(--beacon-gradient);
    min-height: 100vh;
    color: var(--text);
    margin: 0;
    padding: 0;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 180px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(226, 232, 240, 0.6);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(124, 58, 237, 0.03) 100%);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.logo-container:hover {
    background: rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

.logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.brand-text:hover {
    color: var(--primary-dark);
    transform: translateX(2px);
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-weight: 500;
    border-radius: 0 8px 8px 0;
    margin: 2px 8px;
    position: relative;
}

.nav-link:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.06) 100%);
    border-left-color: var(--primary);
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.18) 0%, rgba(37, 99, 235, 0.08) 100%);
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.2);
    transform: translateX(2px);
}

.nav-icon {
    font-size: 1.2rem;
    margin-right: 14px;
    width: 24px;
    text-align: center;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.nav-text {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* Collapsible Menu Styles */
.nav-section {
    margin-bottom: 12px;
}

.nav-parent {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-weight: 600;
    user-select: none;
    border-radius: 0 8px 8px 0;
    margin: 2px 8px;
    position: relative;
    background: rgba(37, 99, 235, 0.02);
}

.nav-parent:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.08) 100%);
    border-left-color: var(--primary);
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.nav-parent.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-left-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.18);
    transform: translateX(2px);
}

.nav-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.8;
    color: var(--primary);
}

.nav-parent.collapsed .nav-arrow {
    transform: rotate(-90deg);
}

.nav-children {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 500px;
    margin: 0 8px;
}

.nav-children.collapsed {
    max-height: 0;
}

.nav-children .nav-link {
    padding-left: 42px;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 1px 0;
    background: rgba(37, 99, 235, 0.01);
}

.nav-children .nav-link .nav-icon {
    font-size: 1rem;
    margin-right: 12px;
    opacity: 0.85;
}

.nav-children .nav-link .nav-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.main-content {
    flex: 1;
    margin-left: 180px;
    padding: 20px;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 10px;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.header-logo {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.header-text {
    text-align: left;
}

header:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

header:hover .header-logo {
    transform: rotate(5deg) scale(1.05);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.tab-btn {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    border-color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px var(--shadow);
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text);
}

.info-text {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

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

/* Results Styling */
.results {
    margin-top: 30px;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.result-section h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

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

.indicator-card {
    background: var(--bg);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.indicator-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.indicator-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.recommendation-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 10px 0;
}

.recommendation-buy {
    background: #d1fae5;
    color: #065f46;
    padding: 2px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.1;
    min-width: 60px;
    text-align: center;
    display: inline-block;
}

.recommendation-strong-buy {
    background: #065f46;
    color: white;
    padding: 2px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.1;
    min-width: 60px;
    text-align: center;
    display: inline-block;
}

.recommendation-sell {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.1;
    min-width: 60px;
    text-align: center;
    display: inline-block;
}

.recommendation-hold {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.1;
    min-width: 60px;
    text-align: center;
    display: inline-block;
}

.reasoning-list {
    list-style: none;
    margin-top: 15px;
}

.reasoning-list li {
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

/* Portfolio Results */
.portfolio-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.summary-card {
    background: var(--bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.summary-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.summary-label {
    color: var(--text-light);
    font-size: 0.8rem;
}

.stocks-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: white;
}

.stocks-table th,
.stocks-table td {
    padding: 10px 10px;
    text-align: left;
    font-size: 0.8125rem;
    line-height: 1.35;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}

.stocks-table th:last-child,
.stocks-table td:last-child {
    border-right: none;
}

/* Header styling */
.stocks-table th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 12px 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stocks-table thead th {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 12px 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

/* Rank column */
.stocks-table--screener th:nth-child(1), /* Rank */
.stocks-table--screener td:nth-child(1) {
    width: 40px;
    text-align: center;
    min-width: 40px;
    max-width: 40px;
}

/* Symbol column */
.stocks-table--screener th:nth-child(2), /* Symbol */
.stocks-table--screener td:nth-child(2) {
    width: 80px;
    min-width: 80px;
    max-width: 100px;
}

.stocks-table--screener th:nth-child(3), /* Price */
.stocks-table--screener td:nth-child(3) {
    width: 70px;
    text-align: right;
    min-width: 70px;
    max-width: 80px;
}

/* Change columns (1D, 1W, 1M, 6M, 1Y) */
.stocks-table--screener th:nth-child(4),
.stocks-table--screener th:nth-child(5),
.stocks-table--screener th:nth-child(6),
.stocks-table--screener th:nth-child(7),
.stocks-table--screener th:nth-child(8),
.stocks-table--screener td:nth-child(4),
.stocks-table--screener td:nth-child(5),
.stocks-table--screener td:nth-child(6),
.stocks-table--screener td:nth-child(7),
.stocks-table--screener td:nth-child(8) {
    width: 55px;
    text-align: right;
    min-width: 55px;
    max-width: 60px;
    font-size: 0.75rem;
    padding: 10px 8px;
}

/* RSI column */
.stocks-table--screener th:nth-child(9),
.stocks-table--screener td:nth-child(9) {
    width: 50px;
    text-align: center;
    min-width: 50px;
    max-width: 55px;
}

/* Pattern columns (VCP, RSI Div, MACD Div, Cross, Breakout) */
.stocks-table--screener th:nth-child(10),
.stocks-table--screener th:nth-child(11),
.stocks-table--screener th:nth-child(12),
.stocks-table--screener th:nth-child(13),
.stocks-table--screener th:nth-child(14),
.stocks-table--screener td:nth-child(10),
.stocks-table--screener td:nth-child(11),
.stocks-table--screener td:nth-child(12),
.stocks-table--screener td:nth-child(13),
.stocks-table--screener td:nth-child(14) {
    width: 45px;
    text-align: center;
    min-width: 45px;
    max-width: 50px;
    font-size: 0.75rem;
    padding: 10px 6px;
}

/* Recommendation column */
.stocks-table--screener th:nth-child(15),
.stocks-table--screener td:nth-child(15) {
    width: 80px;
    text-align: center;
    min-width: 80px;
    max-width: 90px;
}


/* Score column */
.stocks-table--screener th:nth-child(16),
.stocks-table--screener td:nth-child(16) {
    width: 50px;
    text-align: center;
    min-width: 50px;
    max-width: 60px;
}

/* Row styling */
.stocks-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.stocks-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.02);
}

.stocks-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.06);
}

@media print {
    .stocks-table {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .table-wrapper {
        overflow: visible;
        border: 1px solid #e2e8f0;
    }

    .stocks-table th {
        position: static;
    }
}

/* Clickable row styling */
.stocks-table tbody .clickable-row {
    cursor: pointer;
    position: relative;
}

.stocks-table tbody .clickable-row:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), rgba(102, 126, 234, 0.02));
    /* REMOVED transform: scale(1.001) - this was causing alignment issues */
}

.stocks-table tbody .clickable-row:hover td {
    font-weight: 500;
}

.stocks-table tbody .clickable-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.stocks-table tbody .clickable-row:hover::before {
    opacity: 1;
}

.stocks-table tbody tr:last-child {
    border-bottom: none;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .stocks-table--screener {
        min-width: 1100px;
    }
    
    .stocks-table th,
    .stocks-table td {
        font-size: 0.75rem;
        padding: 9px 8px;
    }
}

@media (max-width: 1200px) {
    .stocks-table--screener {
        min-width: 1000px;
    }
    
    .stocks-table th,
    .stocks-table td {
        font-size: 0.72rem;
        padding: 8px 7px;
    }
}

@media (max-width: 768px) {
    .stocks-table th,
    .stocks-table td {
        font-size: 0.75rem;
        padding: 8px 8px;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .header-logo {
        width: 44px;
        height: 44px;
    }
    
    .footer-logo {
        width: 30px;
        height: 30px;
    }
    
    .header-content {
        gap: 14px;
    }
    
    .footer-content {
        gap: 10px;
    }
}

/* Make recommendation and score columns compact */
.stocks-table--screener th:nth-child(15),
.stocks-table--screener th:nth-child(16),
.stocks-table--screener td:nth-child(15),
.stocks-table--screener td:nth-child(16) {
    text-align: center;
    min-width: 70px;
    max-width: 85px;
    font-weight: 600;
}

/* Symbol column */
.stocks-table--screener th:nth-child(2),
.stocks-table--screener td:nth-child(2) {
    min-width: 60px;
    max-width: 70px;
    font-weight: 600;
    position: relative;
    cursor: help;
}

.stocks-table--screener td:nth-child(2):hover::after {
    content: attr(data-company);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Price column */
.stocks-table--screener th:nth-child(3),
.stocks-table--screener td:nth-child(3) {
    min-width: 55px;
    max-width: 65px;
    text-align: right;
    font-size: 0.8125rem;
    padding: 10px 10px;
}

/* Symbol column hover */
.stocks-table--screener td:nth-child(2):hover::after {
    content: attr(data-company);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Fallback: ensure tables inside app wrappers always look professional (even if class differs) */
.table-wrapper > table:not(.stocks-table) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

.table-wrapper > table:not(.stocks-table) thead th {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 12px 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.table-wrapper > table:not(.stocks-table) tbody td {
    padding: 10px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}

.table-wrapper > table:not(.stocks-table) tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.02);
}

.table-wrapper > table:not(.stocks-table) tbody tr:hover {
    background: rgba(37, 99, 235, 0.06);
}

.score-positive {
    color: var(--success);
    font-weight: 600;
}

.score-negative {
    color: var(--danger);
    font-weight: 600;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid var(--danger);
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid var(--success);
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.8;
    font-size: 0.8rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-logo {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
    opacity: 0.9;
    transition: all 0.3s ease;
}

.footer-text {
    text-align: left;
    flex: 1;
    min-width: 250px;
}

.footer-logo:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* Side-by-side Analysis Layout */
.analysis-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.analysis-section {
    background: var(--bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

 .analysis-section.advanced-section {
     margin-top: 20px;
 }

.analysis-section h3 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.1rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

/* Detail Button */
.btn-detail {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.btn-detail:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Horizontal Modal Layout */
.horizontal-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

.fundamental-horizontal,
.technical-horizontal {
    flex: 1;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    min-width: 0;
}

.indicators-horizontal {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.indicator-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.indicator-item {
    flex: 1;
    min-width: 100px;
    background: var(--bg);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    text-align: center;
}

.indicator-item .indicator-label {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.indicator-item .indicator-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.indicator-item .indicator-value.positive {
    color: var(--success);
}

.indicator-item .indicator-value.negative {
    color: var(--danger);
}

/* Responsive adjustments for horizontal modal */
@media (max-width: 768px) {
    .horizontal-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .indicator-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .indicator-item {
        min-width: auto;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 98vw;
    max-height: 90vh;
    width: 98vw;
    height: auto;
    margin: 20px;
    padding: 20px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid var(--border);
    background: var(--bg);
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 30px;
}

 /* Table Styles */
 .modal-content .stocks-table {
     width: 100%;
     border-collapse: collapse;
     background: white;
     border-radius: 8px;
     overflow: hidden;
     box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
 }

 .modal-content .stocks-table th {
     background: var(--primary);
     color: white;
     padding: 12px;
     text-align: left;
     font-weight: 600;
     cursor: pointer;
     user-select: none;
     transition: background 0.3s ease;
 }

 .modal-content .stocks-table th:hover {
     background: var(--secondary);
 }

 .modal-content .stocks-table td {
     padding: 12px;
     border-bottom: 1px solid #e0e0e0;
 }

 .modal-content .stocks-table tr:hover {
     background: #f8f9fa;
 }

.table-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.table-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input, .filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    min-width: 150px;
}

.page-header {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.controls-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    margin-top: 20px;
}

.controls-row .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
    flex: 1;
}

.controls-row .form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
    display: block;
}

.controls-row .form-group input,
.controls-row .form-group select,
.controls-row .form-group textarea {
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.controls-row .form-group input:focus,
.controls-row .form-group select:focus,
.controls-row .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.controls-row .form-group textarea {
    min-width: 300px;
    min-height: 60px;
    resize: vertical;
    font-family: inherit;
}

.controls-row .form-group select {
    min-width: 150px;
    cursor: pointer;
}

.controls-row .form-group select option {
    background: var(--card-bg);
    color: var(--text);
}

.controls-row + .controls-row {
    margin-top: 10px;
}

.controls-row .btn {
    align-self: flex-end;
    margin-top: auto;
    height: fit-content;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Ensure proper alignment for form buttons */
.controls-row .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.controls-row .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.recommendation-buy {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.recommendation-sell {
    background: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.recommendation-hold {
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.btn-details {
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-details:hover {
    background: var(--secondary);
}

.loading-cell {
    text-align: center;
    color: #666;
    font-style: italic;
}

.positive {
    color: #2e7d32;
    font-weight: 500;
}

.negative {
    color: #d32f2f;
    font-weight: 500;
}

.failed-row {
    background: #fff3cd;
}

.failed-cell {
    text-align: center;
    color: #856404;
    font-style: italic;
    padding: 10px;
}

/* Modal Styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.fundamental-data, .technical-data {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.fundamental-data h4, .technical-data h4 {
    margin: 0 0 15px 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.fundamental-item, .technical-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.fundamental-item:last-child, .technical-item:last-child {
    border-bottom: none;
}

.charts-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.charts-section h4 {
    margin: 0 0 15px 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.overbought {
    color: #d32f2f;
    font-weight: 500;
}

.oversold {
    color: #2e7d32;
    font-weight: 500;
}

.neutral {
    color: #f57c00;
    font-weight: 500;
}

.bullish {
    color: #2e7d32;
}

.bearish {
    color: #d32f2f;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .nav-text {
        display: none;
    }
    
    .brand-text {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    /* Mobile header logo adjustments */
    .header-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .header-logo {
        width: 40px;
        height: 40px;
    }
    
    .header-text {
        text-align: center;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    /* Mobile footer logo adjustments */
    .footer-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-logo {
        width: 28px;
        height: 28px;
    }
    
    .footer-text {
        text-align: center;
        min-width: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .indicators-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stocks-table--screener {
        font-size: 0.75rem;
    }
    
    .stocks-table--screener th,
    .stocks-table--screener td {
        padding: 8px 8px;
        font-size: 0.75rem;
    }
    
    .analysis-container {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 20px;
    }
}

/* Import Portfolio Styles */
.import-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Blog Styles */
.blog-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
}

.featured-post {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.featured-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.featured-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.post-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post-category {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    align-self: flex-start;
}

.post-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.9rem;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-date {
    color: var(--text-light);
}

.post-read-time {
    color: var(--text-light);
}

.read-more-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.read-more-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.categories-section {
    margin-top: 2rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.category-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.category-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: 1.1rem;
}

.category-card p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Full Post Styles */
.full-post-container {
    max-width: 800px;
    margin: 0 auto;
}

.back-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 2rem;
    padding: 8px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    color: var(--primary-dark);
    transform: translateX(-4px);
}

.full-post {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.post-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.post-header h1 {
    margin: 1rem 0;
    color: var(--text);
    font-size: 2rem;
    line-height: 1.3;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-content {
    color: var(--text);
    line-height: 1.8;
}

.post-content h2 {
    color: var(--text);
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

.post-content h3 {
    color: var(--text);
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.25rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content pre {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.post-content code {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
}

/* Tutorials Styles */
.tutorials-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
}

.tutorial-filters {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.filter-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tutorials-list {
    margin-top: 1rem;
}

.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.tutorial-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tutorial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tutorial-category {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tutorial-difficulty {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.tutorial-difficulty.beginner {
    background: #d1fae5;
    color: #065f46;
}

.tutorial-difficulty.intermediate {
    background: #fef3c7;
    color: #92400e;
}

.tutorial-difficulty.advanced {
    background: #fee2e2;
    color: #991b1b;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tutorial-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
}

.tutorial-description {
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.9rem;
    flex-grow: 1;
}

.tutorial-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.duration {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topics-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tutorial-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topic-tag {
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.start-tutorial-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.start-tutorial-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Tutorial Viewer Styles */
.tutorial-viewer {
    max-width: 900px;
    margin: 0 auto;
}

.tutorial-header {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.tutorial-info h1 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 2rem;
    line-height: 1.3;
}

.tutorial-info p {
    margin: 0 0 1.5rem 0;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.6;
}

.tutorial-meta-header {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tutorial-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tutorial-step {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.tutorial-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tutorial-step h3 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.3rem;
}

.step-content p {
    margin: 0 0 1rem 0;
    color: var(--text);
    line-height: 1.7;
}

.code-block {
    position: relative;
    margin: 1rem 0;
}

.code-block pre {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text);
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.clear-filter-btn {
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.clear-filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Projects Styles */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
}

.project-stats {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card h3 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.project-filters {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.project-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-category {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.project-status.active {
    background: #d1fae5;
    color: #065f46;
}

.project-status.completed {
    background: #dbeafe;
    color: #1e40af;
}

.project-status.in-development {
    background: #fef3c7;
    color: #92400e;
}

.project-card .card-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-card h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
}

.project-description {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.9rem;
    flex-grow: 1;
}

.project-progress {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-header span {
    font-size: 0.85rem;
    font-weight: 500;
}

.progress-percentage {
    color: var(--primary);
}

.progress-bar {
    background: var(--border);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.success {
    background: #10b981;
}

.progress-fill.warning {
    background: #f59e0b;
}

.progress-fill.danger {
    background: #ef4444;
}

.project-technologies {
    margin-bottom: 1rem;
}

.project-technologies h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: var(--secondary);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-features {
    margin-bottom: 1rem;
}

.project-features h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.project-features ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-features li {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    padding-left: 1rem;
    position: relative;
}

.project-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.more-features {
    color: var(--text-light);
    font-style: italic;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.meta-label {
    color: var(--text-light);
}

.meta-value {
    color: var(--text);
    font-weight: 500;
}

.project-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: var(--primary);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: var(--accent);
    color: white;
}

.action-btn.secondary:hover {
    background: #0891b2;
    transform: translateY(-1px);
}

.action-btn.tertiary {
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
}

.action-btn.tertiary:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Project Details Styles */
.project-details {
    max-width: 1000px;
    margin: 0 auto;
}

.project-header {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.project-info h1 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 2rem;
    line-height: 1.3;
}

.project-info p {
    margin: 0 0 1.5rem 0;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.6;
}

.project-meta-header {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.team-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--background);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--text);
}

.project-actions-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.project-section {
    margin-bottom: 2rem;
}

.project-section:last-child {
    margin-bottom: 0;
}

.project-section h2 {
    margin: 0 0 1.5rem 0;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.overview-item {
    background: var(--background);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.overview-item h3 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
}

.progress-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.progress-bar-large {
    background: var(--border);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.progress-percentage-large {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.timeline-info p {
    margin: 0.25rem 0;
    color: var(--text);
}

.timeline-info strong {
    color: var(--text-light);
}

.team-info p {
    margin: 0 0 0.75rem 0;
    color: var(--text);
}

.team-avatars {
    display: flex;
    gap: 0.5rem;
}

.team-avatar {
    width: 32px;
    height: 32px;
    background: var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

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

.tech-card {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border);
}

.tech-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: 1rem;
}

.tech-card p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.feature-icon {
    font-size: 1.2rem;
}

.feature-text {
    color: var(--text);
    font-size: 0.95rem;
}

.project-gallery {
    background: var(--background);
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid var(--border);
    text-align: center;
}

.gallery-placeholder {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Author Styles */
.author-container {
    max-width: 800px;
    margin: 0 auto;
}

.author-profile {
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    margin-bottom: 30px;
}

.author-avatar {
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    background: var(--beacon-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.author-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.author-title {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 20px;
}

.author-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--primary);
}

.social-icon {
    font-size: 1.1rem;
}

.author-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

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

.author-section:last-child {
    margin-bottom: 0;
}

.author-section h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text);
}

.author-section p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.skill-category h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    background: var(--bg);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.contact-method:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.contact-icon {
    font-size: 1.2rem;
}

/* Responsive Author Styles */
@media (max-width: 768px) {
    .author-profile {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .author-links {
        align-items: center;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-methods {
        align-items: center;
    }
}

.stock-broker {
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

.more-holdings {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-weight: 500;
}

.warning-message {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-weight: 500;
}

/* File input styling */
input[type="file"] {
    border: 2px dashed var(--border);
    background: var(--bg);
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

input[type="file"]::file-selector-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 1rem;
    font-weight: 500;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Stock card enhancements for import */
.stock-card .stock-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.stock-gain {
    grid-column: 1 / -1;
    font-weight: 600;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg);
}

.stock-gain.positive {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.warning-message {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-weight: 500;
}

/* Pattern Badge Styles */
.pattern-badge {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    min-width: 18px;
    cursor: help;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.pattern-badge:hover {
    transform: scale(1.1);
}

.pattern-strong-vcp {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.pattern-weak-vcp {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.pattern-bullish {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.pattern-bearish {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.pattern-confirmed {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.pattern-unconfirmed {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.pattern-none {
    background: var(--border);
    color: var(--text-light);
}

.pattern-insufficient {
    background: var(--text-light);
    color: white;
}

/* Advanced Pattern Analysis Section */
.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.pattern-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pattern-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.pattern-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pattern-details {
    font-size: 0.85rem;
}

.pattern-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-align: center;
}

.pattern-strength {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.pattern-indicators {
    font-size: 0.8rem;
}

.pattern-indicators ul {
    margin: 0.25rem 0 0 1rem;
    padding: 0;
}

.pattern-indicators li {
    margin-bottom: 0.25rem;
    color: var(--text-light);
}

.pattern-description {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.5rem;
    line-height: 1.3;
}

/* Modal Enhancements */
.modal-content {
    max-width: 95vw;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* Side by Side Container */
.side-by-side-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .side-by-side-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Analysis Container */
.analysis-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

/* Section Styling */
.analysis-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.analysis-section h3 {
    margin: 0 0 20px 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-section h4 {
    margin: 15px 0 15px 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

/* Fundamental and Technical Sections */
.fundamental-section {
    border-left: 4px solid var(--success);
}

.technical-section {
    border-left: 4px solid var(--primary);
}

.recommendations-section {
    border-left: 4px solid var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(102, 126, 234, 0.05));
}

.recommendations-section.full-width {
    grid-column: 1 / -1;
    width: 100%;
}

/* Recommendation Summary */
.recommendation-summary {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.recommendation-main,
.score-main {
    text-align: center;
    padding: 20px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.recommendation-large {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    margin: 10px 0;
}

.score-large {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

/* Enhanced Indicator Grid */
.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.indicator-card {
    background: var(--bg);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.indicator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.indicator-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.indicator-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* Pattern Section */
.patterns-section {
    margin-top: 20px;
}

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

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 98vw;
        max-height: 95vh;
    }
    
    .recommendation-summary {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .indicators-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .patterns-grid {
        grid-template-columns: 1fr;
    }
    
    .recommendation-large {
        font-size: 1.2rem;
        padding: 8px 16px;
    }
    
    .score-large {
        font-size: 1.5rem;
    }
}

/* Score Colors */
.score-positive {
    color: var(--success);
}

.score-negative {
    color: var(--danger);
}

.pattern-status.pattern-insufficient {
    background: var(--text-light);
    color: white;
}

/* Pattern status colors */
.pattern-status.pattern-strong-vcp {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.pattern-status.pattern-weak-vcp {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.pattern-status.pattern-bullish {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.pattern-status.pattern-bearish {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.pattern-status.pattern-confirmed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.pattern-status.pattern-none {
    background: var(--bg);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.pattern-status.pattern-insufficient {
    background: var(--text-light);
    color: white;
    border: 1px solid var(--text-light);
}

/* Responsive adjustments for pattern cards */
@media (max-width: 768px) {
    .patterns-grid {
        grid-template-columns: 1fr;
    }
    
    .pattern-badge {
        font-size: 8px;
        padding: 1px 3px;
        min-width: 16px;
    }
}

/* FINAL FIX: Force table alignment */
.stocks-table--screener {
    table-layout: fixed;
    border-collapse: collapse;
}


/* GUARANTEE: Professional table styling always applies */
.table-wrapper .stocks-table thead th {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 12px 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.table-wrapper .stocks-table tbody td {
    padding: 10px 10px !important;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle !important;
}

.table-wrapper .stocks-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.02) !important;
}

.table-wrapper .stocks-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.06) !important;
}

