/* Backend-Integrated Map Styles */

.map-controls {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.color-scheme-selector .form-label {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.color-scheme-selector .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.color-scheme-selector .form-select:focus {
    border-color: var(--aptia-green);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Map Legend Styles */
.map-legend {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.legend-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.legend-label {
    color: #6c757d;
    font-weight: 500;
}

/* Map Statistics Styles */
.map-statistics {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.stats-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
}

.stat-value {
    color: #495057;
    font-weight: 600;
}

/* Loading Indicator Styles */
.map-loading {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #6c757d;
}

.map-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--aptia-green);
}

.map-loading p {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.map-loading small {
    color: #6c757d;
    font-style: italic;
}

/* Error Message Styles */
.map-container .alert {
    margin: 2rem;
    border-radius: 8px;
}

.map-container .alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.map-container .alert-heading {
    color: #721c24;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .map-controls {
        padding: 0.75rem;
    }
    
    .legend-items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stats-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
    }
}

@media (max-width: 576px) {
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    .stats-content {
        grid-template-columns: 1fr;
    }
}

/* Map Container Enhancements */
.map-container {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Plotly Map Customizations */
.js-plotly-plot .plotly .modebar {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 4px;
}

.js-plotly-plot .plotly .modebar-btn {
    color: #495057;
}

.js-plotly-plot .plotly .modebar-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    color: var(--aptia-green);
}

/* Animation for smooth transitions */
.map-controls,
.map-legend,
.map-statistics {
    transition: all 0.3s ease;
}

.map-controls:hover,
.map-legend:hover,
.map-statistics:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Aptia Footer - Fixed Layout with Bold White Title and Equal Spacing */
.aptia-footer-fixed {
    background: white !important;
    border-top: 3px solid var(--aptia-green) !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

.footer-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 15px 20px !important;
    margin: 0 !important;
    min-height: 50px !important;
}

.quick-links-title {
    color: white !important;
    background: var(--aptia-green) !important;
    font-weight: bold !important;
    font-size: 16px !important;
    padding: 8px 15px !important;
    border-radius: 4px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.quick-links-nav {
    display: flex !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 20px !important;
}

.quick-links-nav a {
    color: var(--aptia-green) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

.quick-links-nav a:hover {
    color: white !important;
    background: var(--aptia-green) !important;
    border-color: var(--aptia-green) !important;
    transform: translateY(-2px) !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .footer-row {
        flex-direction: column !important;
        padding: 10px !important;
    }
    
    .quick-links-title {
        margin-bottom: 10px !important;
    }
    
    .quick-links-nav {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 0 !important;
    }
    
    .quick-links-nav a {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
}



/* Legend Formatting Enhancements - Industry Sector Improvements */
.legend-colors-multi {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important; /* Wider columns - increased from 200px to 250px */
    gap: 4px !important; /* Tighter spacing between items */
    max-height: 300px !important; /* Increased height to accommodate more items */
    overflow-y: auto !important;
}

.legend-item {
    font-size: 0.7rem !important; /* Smaller font size - reduced from 0.75rem to 0.7rem */
    line-height: 1.2 !important; /* Tighter line height for compact display */
    margin-bottom: 2px !important; /* Reduced margin between items */
}

/* Ensure the legend color circles remain visible with smaller text */
.legend-color {
    width: 10px !important;
    height: 10px !important;
    margin-right: 6px !important;
    flex-shrink: 0 !important;
}

/* Apply multi-column layout specifically for Industry Sector when it has many items */
#legendColors.legend-colors-multi .legend-item {
    display: flex !important;
    align-items: center !important;
    padding: 1px 0 !important;
}

/**
 * ACT Login System Styles
 */

/* Login Modal Overlay */
#actLoginModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

/* Login Container */
.act-login-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

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

/* Login Header */
.act-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.act-login-header h2 {
    color: var(--aptia-navy);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.act-login-header p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Login Form */
.act-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Group */
.act-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.act-form-group label {
    color: var(--aptia-navy);
    font-weight: 600;
    font-size: 14px;
}

/* Username Group with Status */
.act-username-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.act-username-group input {
    flex: 1;
}

#actUserStatus {
    min-width: 120px;
    font-size: 14px;
    font-weight: bold;
    color: var(--aptia-green);
    text-align: right;
}

/* Input Fields */
.act-form-group input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.act-form-group input:focus {
    outline: none;
    border-color: var(--aptia-teal);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.act-form-group input::placeholder {
    color: #999;
}

/* Password Rules */
.act-password-rules {
    background: #f8f9fa;
    border-left: 3px solid var(--aptia-teal);
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.act-password-rules h4 {
    color: var(--aptia-navy);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.act-password-rules ul {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    color: #666;
}

.act-password-rules li {
    margin-bottom: 4px;
}

/* Error Message */
.act-login-error {
    display: none;
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

/* Login Button */
.act-login-button {
    background: linear-gradient(135deg, var(--aptia-teal) 0%, var(--aptia-navy) 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.act-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.4);
}

.act-login-button:active {
    transform: translateY(0);
}

/* User Display in Navbar */
#currentUserDisplay {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

#currentUserDisplay span {
    color: white;
    font-size: 14px;
}

/* Logout Button */
.act-logout-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.act-logout-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Maintenance Button (SuperUser only) */
#maintenanceButton {
    display: none;
    background: var(--aptia-green);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

#maintenanceButton:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .act-login-container {
        padding: 30px 20px;
        max-width: 95%;
    }
    
    .act-login-header h2 {
        font-size: 24px;
    }
    
    .act-username-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    #actUserStatus {
        text-align: left;
    }
}
/* Menu Layout Fix - Center main menu, keep user controls on right */

.persistent-menu .container-fluid {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 15px !important;
    max-width: 100% !important;
    position: relative !important;
}

.persistent-menu .navbar-brand {
    flex-shrink: 0 !important;
    margin-right: 20px !important;
}

.persistent-menu .navbar-collapse {
    flex-grow: 1 !important;
    display: flex !important;
    justify-content: center !important;
    position: static !important;
}

/* Main navigation items - centered */
.persistent-menu .navbar-nav:not(.ms-auto) {
    display: flex !important;
    flex-direction: row !important;
    margin: 0 !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
}

/* User controls - stay on the right */
.persistent-menu .navbar-nav.ms-auto {
    flex-shrink: 0 !important;
    margin-left: auto !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    position: static !important;
}

.persistent-menu .nav-link {
    white-space: nowrap !important;
    padding: 12px 15px !important;
    font-size: 0.95rem !important;
}

/* Ensure single row */
.persistent-menu {
    min-height: 50px !important;
}

/* Make sure the layout works on desktop */
@media (min-width: 992px) {
    .persistent-menu .navbar-collapse {
        display: flex !important;
    }
    
    .persistent-menu .container-fluid {
        flex-wrap: nowrap !important;
    }
}

/* Mobile responsive */
@media (max-width: 991px) {
    .persistent-menu .container-fluid {
        flex-direction: column !important;
    }
    
    .persistent-menu .navbar-nav:not(.ms-auto),
    .persistent-menu .navbar-nav.ms-auto {
        width: 100% !important;
        margin: 0 !important;
    }
}
/* Agent Enhancement Styles */
.agent-launch-btn {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.agent-launch-btn:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.agent-launch-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.3);
}

/* Enhanced Agent Icons */
.agent-icon i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.agent-card:hover .agent-icon i {
    transform: scale(1.1);
}

/* Specific Icon Colors */
.agent-card:nth-child(1) .agent-icon i { color: #2196F3; } /* Battle Card - Blue */
.agent-card:nth-child(2) .agent-icon i { color: #4CAF50; } /* Company Research - Green */
.agent-card:nth-child(3) .agent-icon i { color: #FF9800; } /* Competitor Watch - Orange */
.agent-card:nth-child(4) .agent-icon i { color: #F44336; } /* Deal Rescue - Red */
.agent-card:nth-child(5) .agent-icon i { color: #9C27B0; } /* Executive Profiler - Purple */
.agent-card:nth-child(6) .agent-icon i { color: #607D8B; } /* Follow-up Email - Blue Grey */
.agent-card:nth-child(7) .agent-icon i { color: #0077B5; } /* LinkedIn Posts - LinkedIn Blue */
.agent-card:nth-child(8) .agent-icon i { color: #795548; } /* Negotiation Strategy - Brown */
.agent-card:nth-child(9) .agent-icon i { color: #E91E63; } /* Objection Handling - Pink */
.agent-card:nth-child(10) .agent-icon i { color: #3F51B5; } /* Pension Accounting - Indigo */
.agent-card:nth-child(11) .agent-icon i { color: #FF5722; } /* Personalised Outreach - Deep Orange */
.agent-card:nth-child(12) .agent-icon i { color: #009688; } /* Risk Mitigation - Teal */
.agent-card:nth-child(13) .agent-icon i { color: #673AB7; } /* Stakeholder Mapping - Deep Purple */
.agent-card:nth-child(14) .agent-icon i { color: #FFC107; } /* Strategic Abandonment - Amber */

/* Extra row agents */
.agents-portfolio-grid-extra .agent-card:nth-child(1) .agent-icon i { color: #4CAF50; } /* Value Engineering - Green */
.agents-portfolio-grid-extra .agent-card:nth-child(2) .agent-icon i { color: #FF4444; } /* Viral Post Generator - Red */

/* Enhanced Tooltips */
.agent-card {
    position: relative;
    cursor: pointer;
}

.agent-card[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    max-width: 300px;
    z-index: 1000;
    white-space: normal;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: tooltipFadeIn 0.3s ease-out;
}

.agent-card[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 95%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 1001;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .agent-card[title]:hover::after {
        font-size: 12px;
        max-width: 250px;
        padding: 6px 10px;
    }
    
    .agent-icon i {
        font-size: 2rem;
    }
    
    .agent-launch-btn {
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* Aptia Footer - Fixed Layout with Bold White Title and Equal Spacing */
.aptia-footer-fixed {
    background: white !important;
    border-top: 3px solid var(--aptia-green) !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

.footer-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 15px 20px !important;
    margin: 0 !important;
    min-height: 50px !important;
}

.quick-links-title {
    color: white !important;
    background: var(--aptia-green) !important;
    font-weight: bold !important;
    font-size: 16px !important;
    padding: 8px 15px !important;
    border-radius: 4px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.quick-links-nav {
    display: flex !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 20px !important;
}

.quick-links-nav a {
    color: var(--aptia-green) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
}

.quick-links-nav a:hover {
    color: white !important;
    background: var(--aptia-green) !important;
    border-color: var(--aptia-green) !important;
    transform: translateY(-2px) !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .footer-row {
        flex-direction: column !important;
        padding: 10px !important;
    }
    
    .quick-links-title {
        margin-bottom: 10px !important;
    }
    
    .quick-links-nav {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 0 !important;
    }
    
    .quick-links-nav a {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
}
