/* ===========================
   🎨 ENHANCED STYLES WITH COMPANY MODALS
   =========================== */

/* ===========================
   📦 COMPANY MODAL
   =========================== */

.company-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

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

.modal-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.modal-header h2 {
    color: #fff;
    font-size: 32px;
    margin: 0 0 10px 0;
}

.modal-ticker {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
}

.modal-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.modal-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.modal-section.full-width {
    grid-column: 1 / -1;
}

.modal-section h3 {
    color: #fff;
    font-size: 16px;
    margin: 0 0 10px 0;
    opacity: 0.8;
}

.modal-section p {
    color: #fff;
    font-size: 18px;
    margin: 0;
    line-height: 1.6;
}

.modal-section ul {
    margin: 0;
    padding-left: 20px;
    color: #fff;
}

.modal-section ul li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .modal-header h2 {
        font-size: 24px;
    }
}

/* ===========================
   🏢 COMPANIES VIEW
   =========================== */

.companies-view {
    padding: 40px;
}

.companies-view h1 {
    color: #2c3e50;
    font-size: 36px;
    margin-bottom: 10px;
}

.view-description {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 40px;
}

.industry-section {
    margin-bottom: 40px;
}

.industry-header {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 20px;
    padding-left: 20px;
    border-left: 5px solid #3498db;
}

.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.company-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.company-card.clickable {
    cursor: pointer;
}

.company-card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.company-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.company-header h3 {
    color: #2c3e50;
    font-size: 18px;
    margin: 0;
}

.company-ticker {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
}

.company-description {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.company-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.companies-summary {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 40px;
}

.companies-summary p {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

.companies-summary strong {
    color: #2c3e50;
}

/* ===========================
   📊 DASHBOARD VIEW
   =========================== */

.dashboard-view {
    padding: 40px;
}

.dashboard-view h1 {
    color: #2c3e50;
    font-size: 36px;
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.9;
}

.stat-detail {
    font-size: 13px;
    opacity: 0.7;
}

.quick-actions {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-actions h2 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 20px;
}

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

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.action-icon {
    font-size: 36px;
}

.action-text {
    font-size: 16px;
    font-weight: 600;
}

/* ===========================
   🔗 GRAPH VIEW
   =========================== */

.graph-view {
    padding: 40px;
}

.graph-view h1 {
    color: #2c3e50;
    font-size: 36px;
    margin-bottom: 10px;
}

#graph-container {
    margin-top: 20px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.loading-message {
    text-align: center;
    padding: 100px;
    font-size: 18px;
    color: #7f8c8d;
}

/* Graph node hover effect */
.graph-node {
    transition: all 0.2s ease;
}

/* ===========================
   ⚠️ ERROR VIEW
   =========================== */

.error-view {
    padding: 60px;
    text-align: center;
}

.error-view h2 {
    color: #e74c3c;
    font-size: 32px;
    margin-bottom: 20px;
}

.error-view p {
    color: #7f8c8d;
    font-size: 18px;
}

/* ===========================
   📱 RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .companies-view,
    .dashboard-view,
    .graph-view {
        padding: 20px;
    }
    
    .companies-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
}
