/* ==================== SIMPLE CLEAN DESIGN ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-light: #f8f9fa;
    --bg-dark: #2d3748;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --accent: #3182ce;
    --accent-hover: #2c5aa0;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --glow: 0 0 20px rgba(49, 130, 206, 0.3);
    --glow-hover: 0 0 30px rgba(49, 130, 206, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-light);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(49, 130, 206, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(49, 130, 206, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(49, 130, 206, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(49, 130, 206, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ==================== HEADER ==================== */

header {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a202c 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(49, 130, 206, 0.5), transparent);
}

.logo-section {
    margin-bottom: 30px;
}

.logo-section h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.logo-section p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

.header-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    width: 100%;
    margin: 30px 0;
}

.main-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    position: relative;
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.language-selector label {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

#language-select {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

#language-select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

#language-select:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.2);
}

#language-select option {
    background: var(--bg-dark);
    color: white;
}

.nav-item {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 6px;
}

.nav-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: translateX(-50%);
    transition: width 0.3s;
}

.nav-item:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-item:hover::before {
    width: 80%;
}

.nav-item.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ==================== MAIN CONTENT ==================== */

main {
    flex: 1;
    padding: 0;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.intro {
    text-align: center;
    margin-bottom: 60px;
    max-width: 100%;
    padding: 40px;
}

.intro h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ==================== CARDS ==================== */

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(49, 130, 206, 0.1), transparent);
    transition: left 0.6s;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    box-shadow: var(--shadow-hover), var(--glow);
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(49, 130, 206, 0.3);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    text-align: center;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.feature-card > p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
}

.features-list {
    list-style: none;
    margin-bottom: 30px;
}

.features-list li {
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.features-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.cta-button {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4), var(--glow);
}

/* ==================== INFO SECTION ==================== */

.info-section {
    margin-top: 60px;
    padding-top: 60px;
    border-top: 1px solid var(--border);
}

.info-section h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 40px;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.info-item {
    text-align: center;
}

.info-item h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.info-item p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ==================== FOOTER ==================== */

footer {
    background: var(--bg-dark);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

footer a {
    color: white;
    text-decoration: underline;
}

footer a:hover {
    opacity: 0.8;
}

.footer-note {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* ==================== CHART PAGES ==================== */

.chart-container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 40px;
    margin: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chart-container:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Trading section spacing */
.container > .trading-section {
    margin: 0;
    border-left: none;
    border-right: none;
    border-radius: 0;
}

.chart-header {
    margin-bottom: 30px;
}

.chart-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.currency-select,
.crypto-select,
.timeframe-btn,
.market-type-btn {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.currency-select:hover,
.crypto-select:hover {
    border-color: var(--accent);
}

.forex-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vs {
    color: var(--text-secondary);
    font-weight: 500;
}

.currency-select:hover,
.timeframe-btn:hover,
.market-type-btn:hover {
    border-color: var(--accent);
}

.timeframe-btn.active,
.market-type-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3), var(--glow);
    transform: translateY(-2px);
}

.price-info {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
    border-radius: 12px;
    border: 1px solid rgba(49, 130, 206, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.price-info:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), var(--glow);
    transform: translateY(-2px);
}

.price-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-item .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.price-item .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Override for colored change values */
.price-item .value.positive,
.price-item .value.negative {
    font-size: 1.5rem;
    font-weight: 600;
}

/* ==================== AI PREDICTION SECTION ==================== */

.prediction-section {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.prediction-section:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(16, 185, 129, 0.1);
}

.prediction-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.toggle-prediction-btn,
.show-prediction-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.toggle-prediction-btn:hover,
.show-prediction-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.chart-header-actions {
    margin: 15px 0;
    display: flex;
    justify-content: flex-end;
}

.prediction-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.prediction-recommendation {
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border-left: 4px solid #10b981;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recommendation-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.recommendation-action {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
}

.recommendation-action.buy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.recommendation-action.sell {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.recommendation-action.hold {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.recommendation-reason {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.prediction-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.prediction-stat {
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

.stat-value.confidence-high {
    color: #10b981;
}

.stat-value.confidence-medium {
    color: #f59e0b;
}

.stat-value.confidence-low {
    color: #ef4444;
}

#forex-chart,
#crypto-chart {
    max-height: 400px;
    width: 100% !important;
    height: 400px !important;
    position: relative;
    display: block;
}

canvas {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Chart.js Tooltip Styling */
.chartjs-tooltip {
    position: absolute !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    padding: 12px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    pointer-events: none !important;
    z-index: 1000 !important;
    opacity: 0 !important;
    transition: opacity 0.2s !important;
    max-width: 200px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.chartjs-tooltip-active {
    opacity: 1 !important;
}

/* ==================== TRADING SECTION ==================== */

.trading-section {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, var(--bg-light) 100%);
    border-top: 1px solid var(--border);
    padding: 0;
    margin: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    position: relative;
}

.trading-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(49, 130, 206, 0.3), transparent);
}

.trading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.trading-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.toggle-trading-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.toggle-trading-btn:hover {
    background: var(--accent-hover);
}

.trading-panel {
    padding: 40px;
    background: var(--card-bg);
}

.balance-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    height: fit-content;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.balance-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), var(--glow);
    border-color: rgba(49, 130, 206, 0.3);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.balance-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.trading-dashboard {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .trading-dashboard {
        grid-template-columns: 1fr;
    }
}

.trading-form-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    height: fit-content;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.trading-form-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), var(--glow);
    border-color: rgba(49, 130, 206, 0.3);
}

.trading-form-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.execute-trade-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.execute-trade-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.execute-trade-btn:hover::before {
    width: 400px;
    height: 400px;
}

.execute-trade-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4), var(--glow);
}

/* ==================== TABLES ==================== */

.portfolio-table-container,
.trade-history-container {
    overflow-x: auto;
}

.portfolio-table,
.trade-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.portfolio-table th,
.trade-history-table th {
    background: var(--bg-light);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    border-bottom: 2px solid var(--border);
}

.portfolio-table td,
.trade-history-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ==================== NEWS PAGE ==================== */

.news-page,
.landing-page {
    padding: 40px;
    min-height: auto;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.intro {
    padding: 40px;
}

.cards-container {
    padding: 0 40px 40px 40px;
}

.info-section {
    padding: 0 40px 60px 40px;
}

.news-controls {
    margin-bottom: 30px;
}

.news-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.news-tab-btn {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.news-tab-btn:hover {
    border-color: var(--accent);
}

.news-tab-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.news-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.news-loading p {
    margin: 0;
    order: 1;
}

.news-loading .loading-spinner {
    order: 2;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.news-error {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(49, 130, 206, 0.1), transparent);
    transition: left 0.6s;
}

.news-card:hover::before {
    left: 100%;
}

.news-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), var(--glow);
    border-color: rgba(49, 130, 206, 0.3);
}

.news-card {
    padding: 24px;
    cursor: pointer;
}

.news-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.news-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.news-card .news-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.article-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 1000;
}

.article-modal.active {
    display: block;
}

.article-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
}

.article-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 900px;
    max-height: 90vh;
    margin: 50px auto;
    overflow-y: auto;
    padding: 40px;
    box-shadow: var(--shadow-hover);
}

.article-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 1001;
}

.article-modal-close:hover {
    color: var(--text-primary);
}

.article-loader {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.article-loader p {
    margin: 0;
    order: 1;
}

.article-loader .loading-spinner {
    order: 2;
}

.article-content {
    color: var(--text-primary);
    line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 12px;
}

.article-content p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 20px 0;
}

/* ==================== PRICE ANIMATIONS ==================== */

.price-up {
    color: #48bb78 !important;
}

.price-down {
    color: #f56565 !important;
}

.positive {
    color: #48bb78 !important;
    font-weight: 600;
}

.negative {
    color: #f56565 !important;
    font-weight: 600;
}

/* Ensure price change elements show colors */
#price-change.positive,
#price-change.negative,
#forex-change.positive,
#forex-change.negative {
    display: inline-block;
}

/* ==================== ASSET SELECTOR ==================== */

.asset-selector-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.asset-selector-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.asset-selector-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.asset-selector-btn {
    padding: 20px 40px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.asset-selector-btn:hover {
    border-color: var(--accent);
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow), var(--glow);
    background: rgba(49, 130, 206, 0.1);
}

.asset-selector-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-color: var(--accent);
    color: white;
    box-shadow: var(--shadow-hover), var(--glow-hover);
    transform: translateY(-2px) scale(1.02);
}

.asset-selector-btn.active .asset-icon,
.asset-selector-btn.active .asset-name {
    color: white;
}

.asset-selector-hint {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ==================== MODALS ==================== */

.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 1000;
}

.confirmation-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.confirmation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
}

.confirmation-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-hover);
    position: relative;
    z-index: 1001;
    padding: 40px;
}

.confirmation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.confirmation-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.confirmation-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.confirmation-close:hover {
    color: var(--text-primary);
}

.confirmation-body {
    margin-bottom: 30px;
}

.confirmation-body p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.confirmation-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirmation-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.confirmation-confirm {
    background: var(--accent);
    color: white;
}

.confirmation-confirm:hover {
    background: var(--accent-hover);
}

.confirmation-cancel {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.confirmation-cancel:hover {
    background: var(--border);
}

/* ==================== TOAST NOTIFICATIONS ==================== */

.notification-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: var(--shadow-hover);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 1001;
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.notification-toast.show {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}


.notification-toast.success {
    border-left: 4px solid #48bb78;
}

.notification-toast.error {
    border-left: 4px solid #f56565;
}

.notification-toast.warning {
    border-left: 4px solid #ed8936;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

/* ==================== LIQUIDATION WARNING ==================== */

.liquidation-warning {
    background: #fff5f5;
    border: 1px solid #fc8181;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.warning-icon {
    width: 24px;
    height: 24px;
    background: #f56565;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.warning-icon::before {
    content: '!';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.warning-text {
    flex: 1;
    color: var(--text-primary);
}

.warning-text strong {
    color: #c53030;
}

/* ==================== TRADE TYPE SELECTOR ==================== */

.trade-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.trade-type-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.trade-type-btn:hover {
    border-color: var(--accent);
}

.trade-type-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ==================== PORTFOLIO & TRADE HISTORY ==================== */

.portfolio-section,
.trade-history-section {
    margin-top: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.portfolio-section:hover,
.trade-history-section:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), var(--glow);
    transform: translateY(-2px);
}

.portfolio-section {
    margin-bottom: 30px;
}

.portfolio-section h3,
.trade-history-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.close-position-btn {
    padding: 6px 12px;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.close-position-btn:hover {
    background: #e53e3e;
}

.reset-balance-btn {
    padding: 6px 12px;
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-balance-btn:hover {
    background: var(--border);
}

.portfolio-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

.portfolio-value .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.portfolio-value .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.no-holdings,
.no-trades {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

.form-hint {
    color: var(--text-secondary);
    font-weight: normal;
    font-size: 0.85rem;
}

/* ==================== MARKET TYPE SELECTOR ==================== */

.market-type-selector {
    display: flex;
    gap: 12px;
}

.market-type-btn {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.market-type-btn:hover {
    border-color: var(--accent);
}

.market-type-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .language-selector {
        top: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .language-selector label {
        font-size: 0.8rem;
    }
    
    #language-select {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    main,
    .news-page,
    .landing-page {
        padding: 0;
    }

    .intro {
        padding: 20px;
    }

    .cards-container {
        padding: 0 20px 20px 20px;
    }

    .info-section {
        padding: 0 20px 40px 20px;
    }

    .chart-container,
    .container > .chart-container {
        margin: 0;
        padding: 20px;
    }

    .container > .trading-section {
        margin: 0;
        padding: 20px;
    }

    .cards-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .main-navigation {
        gap: 20px;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .price-info {
        flex-direction: column;
        gap: 20px;
    }

    .prediction-stats {
        grid-template-columns: 1fr;
    }

    .prediction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .chart-header-actions {
        justify-content: center;
    }

    .notification-toast {
        right: 20px;
        left: 20px;
        min-width: auto;
    }

    #forex-chart,
    #crypto-chart {
        height: 300px !important;
    }
}

/* ==================== MARKET SENTIMENT PAGE ==================== */

.sentiment-page {
    padding: 30px 0;
}

.sentiment-header {
    margin-bottom: 30px;
}

.sentiment-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
    border-radius: 12px;
    border: 1px solid rgba(49, 130, 206, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.refresh-sentiment-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.2);
}

.refresh-sentiment-btn:hover {
    background: linear-gradient(135deg, #2c5aa0 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
    transform: translateY(-2px);
}

.refresh-sentiment-btn .btn-icon {
    font-size: 1.2rem;
    animation: none;
}

.refresh-sentiment-btn:hover .btn-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sentiment-date {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sentiment-date .label {
    font-weight: 500;
}

.sentiment-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(49, 130, 206, 0.1);
    border-top-color: #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.sentiment-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: rgba(239, 68, 68, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.sentiment-error h3 {
    color: #ef4444;
    margin-bottom: 10px;
}

.retry-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #dc2626;
}

.sentiment-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sentiment-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    border-radius: 12px;
    border: 1px solid rgba(49, 130, 206, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.sentiment-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.sentiment-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(49, 130, 206, 0.1);
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.05) 0%, transparent 100%);
}

.sentiment-card .card-header h2,
.sentiment-card .card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.sentiment-card .card-header h3 {
    font-size: 1.1rem;
}

.sentiment-card .card-body {
    padding: 20px;
}

.sentiment-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.sentiment-badge.bullish {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.sentiment-badge.bearish {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.sentiment-badge.neutral {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.segment-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.segment-badge.bullish {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.segment-badge.bearish {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.segment-badge.neutral {
    background: rgba(107, 114, 128, 0.1);
    color: #4b5563;
}

.sentiment-summary p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin: 0;
}

.segment-analysis p {
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.key-points {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.key-points li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
    color: var(--text-secondary);
}

.key-points li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #3182ce;
    font-weight: bold;
}

.sentiment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(49, 130, 206, 0.05);
    border-radius: 8px;
    border-left: 4px solid #3182ce;
}

.insight-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.insight-text {
    flex: 1;
    line-height: 1.6;
    color: var(--text-primary);
}

.news-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-item {
    padding: 15px;
    background: rgba(49, 130, 206, 0.03);
    border-radius: 8px;
    border-left: 4px solid #3182ce;
    transition: all 0.2s;
}

.news-item:hover {
    background: rgba(49, 130, 206, 0.08);
    transform: translateX(5px);
}

.news-item h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.news-item p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.api-notice {
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 12px;
    border: 2px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.notice-content h3 {
    margin-top: 0;
    color: #d97706;
}

.notice-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.notice-content li {
    margin: 10px 0;
    line-height: 1.6;
}

.notice-content a {
    color: #3182ce;
    text-decoration: none;
    font-weight: 500;
}

.notice-content a:hover {
    text-decoration: underline;
}

.api-config-example {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    border-left: 4px solid #3182ce;
}

.api-config-example pre {
    margin: 10px 0 0 0;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.api-config-example code {
    font-family: 'Courier New', monospace;
    color: #059669;
}

/* Responsive Design for Sentiment Page */
@media (max-width: 768px) {
    .sentiment-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sentiment-grid {
        grid-template-columns: 1fr;
    }

    .sentiment-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* ==================== CHATBOT PAGE ==================== */

.chatbot-page {
    padding: 40px;
    min-height: calc(100vh - 200px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.chatbot-container {
    max-width: 900px;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    min-height: 600px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chatbot-container:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), var(--glow);
}

.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.05) 0%, transparent 100%);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chatbot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.chatbot-header-info h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chatbot-status {
    margin: 4px 0 0 0;
    font-size: 0.85rem;
    color: #10b981;
    font-weight: 500;
}

.chatbot-status::before {
    content: '●';
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-actions {
    display: flex;
    gap: 10px;
}

.chatbot-action-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-action-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-1px);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg-light);
}

.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.message-content {
    flex: 1;
    max-width: 75%;
}

.user-message .message-content {
    text-align: right;
}

.message-text {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    word-wrap: break-word;
}

.bot-message .message-text {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.user-message .message-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.2);
}

.message-text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 4px 0;
}

.message-text a {
    color: var(--accent);
    text-decoration: underline;
}

.user-message .message-text a {
    color: rgba(255, 255, 255, 0.9);
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 6px;
    opacity: 0.7;
}

.chatbot-suggestions {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 1px solid var(--border);
    background: white;
}

.chatbot-suggestions.show {
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.suggestion-category {
    margin-bottom: 24px;
}

.suggestion-category:last-child {
    margin-bottom: 0;
}

.suggestion-category h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-chip {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.2);
}

.chatbot-input-container {
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    background: white;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: var(--bg-light);
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.chatbot-send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.2);
}

.chatbot-send-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.chatbot-send-btn:active {
    transform: translateY(0);
}

.chatbot-typing-indicator {
    display: none;
    padding: 12px 16px;
    gap: 6px;
    align-items: center;
}

.chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: typing 1.4s infinite;
}

.chatbot-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsive Design for Chatbot */
@media (max-width: 768px) {
    .chatbot-page {
        padding: 20px;
    }

    .chatbot-container {
        height: calc(100vh - 200px);
        min-height: 500px;
    }

    .chatbot-header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .chatbot-header-info {
        flex: 1;
        min-width: 200px;
    }

    .chatbot-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .chatbot-header-info h2 {
        font-size: 1.1rem;
    }

    .chatbot-messages {
        padding: 16px;
    }

    .message-content {
        max-width: 85%;
    }

    .chatbot-input-container {
        padding: 12px 16px;
    }

    .chatbot-suggestions.show {
        max-height: 300px;
        padding: 16px;
    }

    .suggestion-chips {
        gap: 8px;
    }

    .suggestion-chip {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* ==================== AGENT FEATURES ==================== */

.agent-notice {
    padding: 12px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.agent-notice-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.agent-notice-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.agent-notice-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.agent-notice-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.agent-notice-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.agent-message .message-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.agent-badge {
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.agent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.agent-modal.active {
    display: flex;
}

.agent-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.agent-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2001;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.agent-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.agent-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.agent-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.agent-modal-close:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.agent-modal-body {
    padding: 24px;
}

.agent-modal-body p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.agent-modal-body ol {
    margin: 20px 0;
    padding-left: 25px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.agent-modal-body li {
    margin: 10px 0;
}

.agent-form {
    margin-top: 30px;
}

.agent-form .form-group {
    margin-bottom: 20px;
}

.agent-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.agent-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.agent-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.agent-form small {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.agent-save-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.agent-save-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
}

.agent-info {
    margin-top: 30px;
    padding: 20px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.agent-info p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.agent-info strong {
    color: #d97706;
}

/* Responsive for Agent Modal */
@media (max-width: 768px) {
    .agent-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .agent-modal-header {
        padding: 20px;
    }

    .agent-modal-body {
        padding: 20px;
    }
}