/* Main Styles */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8faf8; /* Lighter background with green tint */
    color: #333;
    line-height: 1.6;
    padding-top: 50px; /* Updated to match navbar height */
}

/* Note: All pages now use the same header padding for consistency */

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2e7d32; /* Dark green for headings */
}

/* Navigation Bar Styles - Base styles */
.navbar {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.75rem !important; /* Reduced horizontal padding */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    transition: all 0.3s ease;
    min-height: 50px !important; /* Increased by 25% from 40px */
    max-height: 50px !important; /* Increased by 25% from 40px */
    height: 50px !important; /* Increased by 25% from 40px */
}

/* Welcome pages navbar style */
.navbar-welcome {
    background-color: #4caf50; /* Medium green */
}

/* Portfolio pages navbar style */
.navbar-portfolio {
    background-color: #4caf50; /* Medium green */
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.2rem; /* Even smaller font size */
    color: #ffffff !important;
    padding: 0.1rem 0; /* Reduced vertical padding */
    line-height: 1.8 !important;
    font-size: 0.9rem !important;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    margin: 0 0.15rem; /* Smaller margin */
    padding: 0.3rem 0.4rem; /* Increased vertical padding */
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem; /* Smaller font size */
    line-height: 1.8 !important;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.15);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.dropdown-item {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #e8f5e9; /* Very light green */
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    margin-left: auto;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none !important;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Container Styles */
.container {
    padding: 1.25rem 0.75rem; /* Reduced padding for all containers */
}

/* Note: All page types now use the same container padding for consistency */

/* Button Styles */
.btn {
    border-radius: 4px;
    font-weight: 500;
    padding: 0.4rem 1.25rem; /* Reduced padding */
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #43a047; /* Green button */
    border-color: #43a047;
}

.btn-primary:hover {
    background-color: #388e3c;
    border-color: #388e3c;
}

.btn-outline-primary {
    color: #43a047;
    border-color: #43a047;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #43a047;
    border-color: #43a047;
}

/* Keep the danger buttons as is */
.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.25rem; /* Reduced margin */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 7px 10px rgba(0, 0, 0, 0.1);
}

.card-title {
    color: #2e7d32; /* Dark green */
    font-weight: 700;
}

.card-img-top {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* Form Styles */
.form-control {
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 0.6rem 0.8rem; /* Reduced padding */
}

.form-control:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

/* Enhanced table styles for minimalist design */
.styled-table,
table.table:not(#SecurityAddTable):not(#RequiredSecuritiesTable):not(#sell_securities_table):not(.dataTable) {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 1rem 0;
    font-size: 0.95em;
    font-family: var(--font-family-base);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
}

.styled-table thead th,
table.table:not(#SecurityAddTable):not(#RequiredSecuritiesTable):not(#sell_securities_table):not(.dataTable) thead th {
    background-color: #4caf50;
    color: #ffffff;
    text-align: left;
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 1px solid #dddddd;
}

.styled-table tbody tr,
table.table:not(#SecurityAddTable):not(#RequiredSecuritiesTable):not(#sell_securities_table):not(.dataTable) tbody tr {
    border-bottom: 1px solid #dddddd;
    transition: background-color 0.2s ease;
}

.styled-table tbody tr:nth-of-type(even),
table.table:not(#SecurityAddTable):not(#RequiredSecuritiesTable):not(#sell_securities_table):not(.dataTable) tbody tr:nth-of-type(even) {
    background-color: #f5f9f5;
}

.styled-table tbody tr:last-of-type,
table.table:not(#SecurityAddTable):not(#RequiredSecuritiesTable):not(#sell_securities_table):not(.dataTable) tbody tr:last-of-type {
    border-bottom: 2px solid #4caf50;
}

.styled-table tbody td,
table.table:not(#SecurityAddTable):not(#RequiredSecuritiesTable):not(#sell_securities_table):not(.dataTable) tbody td {
    padding: 12px 15px;
}

.styled-table tbody tr:hover,
table.table:not(#SecurityAddTable):not(#RequiredSecuritiesTable):not(#sell_securities_table):not(.dataTable) tbody tr:hover {
    background-color: #e8f5e9;
}

.styled-table tbody tr.active-row,
table.table:not(#SecurityAddTable):not(#RequiredSecuritiesTable):not(#sell_securities_table):not(.dataTable) tbody tr.active-row {
    font-weight: 500;
    color: #4caf50;
    background-color: #e8f5e9;
}

/* Apply styled-table class automatically to all tables in content areas */
/* FAQ page tables and welcome page tables will inherit these styles */
main .container table:not(.no-style):not(.dataTable):not(#SecurityAddTable):not(#RequiredSecuritiesTable):not(#sell_securities_table) {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Styling for specific security tables that are excluded from the general styling */
#SecurityAddTable, 
#RequiredSecuritiesTable, 
#sell_securities_table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Add more space to portfolio overview page */
.portfolio-overview {
    padding-top: 30px;
    margin-top: 20px;
}

/* Larger user profile icon in navbar */
.navbar .profile-icon {
    font-size: 1.4rem; /* Bigger profile icon */
    margin-right: 5px;
    vertical-align: middle;
}

/* User dropdown menu styling */
.user-dropdown {
    min-width: 250px;
    padding: 1rem;
    right: 0 !important;
    left: auto !important;
}

.dropdown-menu.user-dropdown {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    transform-origin: top right !important;
}

.user-dropdown .user-info {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9e9e9;
    margin-bottom: 0.75rem;
}

.user-dropdown .user-name {
    font-weight: 600;
    font-size: 1rem;
    color: #2e7d32;
    margin-bottom: 0.25rem;
}

.user-dropdown .user-email {
    font-size: 0.85rem;
    color: #666;
}

.user-dropdown .account-details {
    font-size: 0.85rem;
}

.user-dropdown .account-details p {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
}

.user-dropdown .account-details strong {
    color: #2e7d32;
}

.user-dropdown .dropdown-divider {
    margin: 0.75rem 0;
    border-color: #e9e9e9;
}

.user-dropdown .dropdown-item {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.user-dropdown .dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
    color: #2e7d32;
}

/* Responsive tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Fix for accordion functionality */
.accordion-button:not(.collapsed) {
    color: #2e7d32; /* Dark green for active accordion */
    background-color: #f1f8e9; /* Very light green background */
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.accordion-button:focus {
    border-color: #81c784; /* Light green border */
    box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25); /* Green glow */
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232e7d32'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-body {
    padding: 1rem;
    background-color: #fff;
}

.accordion-item {
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
    border-radius: 6px;
    overflow: hidden;
}

/* Specific styles for FAQ accordions */
#faqAccordion .accordion-button,
#reviewSuggestionsAccordion .accordion-button {
    font-weight: 500;
    padding: 0.75rem 1rem;
}

#faqAccordion .accordion-body,
#reviewSuggestionsAccordion .accordion-body {
    padding: 1rem;
    color: #555;
}

/* Hero Section Styles */
.hero-section {
    background-color: #4caf50; /* Medium green */
    color: white;
    padding: 3rem 1.5rem; /* Reduced padding */
    text-align: center;
    margin-bottom: 1.5rem; /* Reduced margin */
    border-radius: 0;
    position: relative;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.hero-section p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Benefits List */
.benefits-list {
    list-style-type: none;
    padding-left: 0;
}

.benefits-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #c8e6c9;
}

.benefits-list li:last-child {
    border-bottom: none;
}

/* Footer Styles */
footer {
    background-color: #2e7d32; /* Dark green */
    color: white;
    padding: 0.4rem 0; /* Reduced padding */
    margin-top: 1.5rem; /* Reduced margin */
    font-size: 0.8rem; /* Smaller font */
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s;
}

footer a:hover {
    color: white;
    text-decoration: none;
}

.social-links a {
    font-size: 1rem; /* Smaller icon size */
    color: rgba(255, 255, 255, 0.9);
}

.social-links a:hover {
    color: white;
}

.legal-links a {
    font-size: 0.75rem; /* Smaller legal text */
    color: rgba(255, 255, 255, 0.7);
}

/* Media Queries */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
}

/* Dashboard specific styles */
.dashboard-card {
    margin-bottom: 1.5rem;
}

.portfolio-summary {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    position: relative;
    height: 350px;
    margin-bottom: 2rem;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.asset-allocation {
    margin-top: 2rem;
}

.performance-metrics {
    margin-top: 2rem;
}

/* Login and Registration Forms */
.auth-form-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.auth-form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form-container .form-group {
    margin-bottom: 1.5rem;
}

.auth-form-container .btn {
    display: block;
    width: 100%;
    margin-top: 1rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: #1e3a8a;
}

/* Adjust main content to account for fixed navbar */
main {
    margin-top: 0.75rem; /* Reduced buffer between navbar and content */
    padding-top: 0.25rem; /* Reduced padding at the top of content */
}

/* Accessibility - Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1e3a8a;
    color: white;
    padding: 8px;
    z-index: 1031;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
    outline: none;
}

/* Mobile Navigation Styles */
@media (max-width: 991.98px) {
    .navbar {
        max-height: none !important; /* Allow navbar to expand when menu is open */
        display: flex !important;
        align-items: center !important;
        padding: 0.15rem 0.5rem !important;
    }
    
    .navbar .container {
        padding-top: 0;
        padding-bottom: 0;
        display: flex;
        align-items: center;
    }
    
    .navbar-collapse {
        background-color: #4caf50; /* Match navbar color */
        padding: 10px;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1050;
        position: absolute;
        left: 0;
        right: 0;
        top: 50px;
        width: 100%;
    }
    
    .navbar-brand {
        display: flex !important;
        align-items: center;
        margin-right: auto;
        font-size: 1rem !important;
    }
    
    .navbar-toggler {
        display: flex !important;
        position: relative !important;
        align-items: center;
        justify-content: center;
        margin-left: auto !important;
        margin-right: 0 !important;
        padding: 0.25rem 0.5rem !important;
        height: 34px !important;
        width: 34px !important;
        color: white !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
        border-radius: 4px !important;
        z-index: 1060;
    }
    
    .navbar-toggler-icon {
        height: 1.2em !important;
        width: 1.2em !important;
        background-size: 100%;
    }
    
    .navbar-nav {
        padding: 0.5rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.4rem 0.6rem;
        margin: 0.15rem 0;
        font-size: 0.9rem;
        text-align: left;
    }
    
    .dropdown-menu {
        border: none;
        background-color: rgba(255, 255, 255, 0.05);
        padding-left: 1rem;
        position: static !important;
        float: none;
        width: auto;
        margin-top: 0;
        box-shadow: none;
    }
    
    .dropdown-item {
        color: rgba(255, 255, 255, 0.8) !important;
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff !important;
    }
    
    /* Fix for action buttons in mobile view */
    .navbar .btn-sm {
        margin: 0.4rem 0.2rem;
        display: inline-block;
        width: auto;
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Fix for login/register buttons in mobile */
    .navbar-nav > .nav-item > .btn {
        margin: 0.3rem 0;
        text-align: left;
        display: inline-flex;
        align-items: center;
    }
    
    body {
        padding-top: 50px; /* Adjust for mobile */
    }
    
    main {
        margin-top: 0.5rem;
    }
}

/* Special action buttons in navbar */
.navbar .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    box-shadow: none;
    border: 1px solid transparent;
}

/* Dropdown menu positioning fix */
@media (min-width: 992px) {
    .navbar .dropdown-menu {
        margin-top: 0;
    }
    
    .dropdown-menu.user-dropdown {
        position: absolute;
        right: 0 !important;
        left: auto !important;
    }
}

/* JavaScript fix for the dropdown menu - will be added to global scripts section */
/* 
document.addEventListener('DOMContentLoaded', function() {
    // Fix user dropdown positioning
    const userDropdown = document.querySelector('.user-dropdown');
    if (userDropdown) {
        userDropdown.style.right = '0';
        userDropdown.style.left = 'auto';
    }
});
*/

.navbar .text-success {
    color: #2e7d32 !important;
}

.navbar .btn-light {
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

.navbar .btn-light:hover {
    background-color: #ffffff;
    transform: translateY(-1px);
}

/* Mobile adjustments for action buttons */
@media (max-width: 991.98px) {
    .navbar .btn-sm {
        margin: 0.5rem 0;
        display: inline-block;
    }
}

/* Portfolio performance indicators */
.performance-high {
    color: #388e3c !important; /* Green for high performance */
}

.performance-medium {
    color: #ffa000 !important; /* Yellow for medium performance */
}

.performance-low {
    color: #d32f2f !important; /* Red for low performance */
}

/* Volatility indicators */
.volatility-low {
    color: #388e3c !important; /* Green for low volatility */
}

.volatility-medium {
    color: #ffa000 !important; /* Yellow for medium volatility */
}

.volatility-high {
    color: #d32f2f !important; /* Red for high volatility */
}

/* End of CSS */

/* Volatility high indicator */
.volatility-high {
    color: #d32f2f;
    font-weight: bold;
}

/* Tutorial Mode Styles */
#tutorial-mode-btn {
    background-color: #ffffff;
    color: #2196F3;
    border: 2px solid #2196F3;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-left: 10px;
}

#tutorial-mode-btn::before {
    content: "ℹ️";
    margin-right: 5px;
    font-size: 14px;
}

#tutorial-mode-btn:hover {
    background-color: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#tutorial-mode-btn.active {
    background-color: #2196F3;
    color: #ffffff;
    border-color: #2196F3;
    animation: tutorial-pulse 1.5s infinite;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.5);
}

#tutorial-mode-btn.active::before {
    content: "✓";
}

@keyframes tutorial-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}

.tutorial-tooltip {
    position: absolute;
    background-color: #ffffff;
    border: 2px solid #2196F3;
    border-radius: 12px;
    padding: 18px;
    max-width: 350px;
    z-index: 1050;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: auto;
    transform: translateY(10px);
}

.tutorial-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tutorial-tooltip h5 {
    color: #2196F3;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.tutorial-tooltip p {
    color: #333;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.tutorial-tooltip .btn {
    margin-top: 5px;
    transition: all 0.2s ease;
}

.tutorial-tooltip .btn-outline-secondary {
    color: #2196F3;
    border-color: #2196F3;
}

.tutorial-tooltip .btn-outline-secondary:hover {
    background-color: #2196F3;
    color: white;
}

/* Arrow styles deleted */

.tutorial-element {
    position: relative;
    cursor: help !important;
}

.tutorial-element:hover {
    outline: 2px dashed #2196F3;
    outline-offset: 2px;
    background-color: rgba(33, 150, 243, 0.05) !important;
    position: relative;
    z-index: 100;
}

.tutorial-element.tutorial-clicked {
    animation: tutorial-click-feedback 0.3s ease-out;
}

/* Make it very obvious which elements have tutorial content */
.tutorial-element::before {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background-color: #2196F3;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 200;
}

/* Show the indicator when tutorial mode is active */
.tutorial-element:hover::before {
    opacity: 0.8;
    transform: scale(1);
}

@keyframes tutorial-click-feedback {
    0% {
        background-color: rgba(33, 150, 243, 0.3);
        transform: scale(0.98);
    }
    100% {
        background-color: rgba(33, 150, 243, 0);
        transform: scale(1);
    }
}

.tutorial-element.highlight {
    position: relative;
    z-index: 1040;
    outline: 3px solid #2196F3 !important;
    outline-offset: 3px !important;
    background-color: rgba(33, 150, 243, 0.1) !important;
}

.tutorial-element.highlight::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px dashed #2196F3;
    border-radius: 4px;
    background-color: rgba(33, 150, 243, 0.1);
    z-index: -1;
    pointer-events: none;
    animation: tutorial-highlight-pulse 2s infinite;
}

@keyframes tutorial-highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}

/* Special styling for table headers in tutorial mode */
.tutorial-table-header {
    position: relative;
    cursor: help !important;
    background-color: rgba(33, 150, 243, 0.1) !important;
}

.tutorial-table-header:hover,
.tutorial-table-header:focus {
    background-color: rgba(33, 150, 243, 0.2) !important;
    outline: 2px dashed #2196F3 !important;
    outline-offset: -2px !important;
}

.tutorial-table-header:hover::after,
.tutorial-table-header.highlight::after {
    content: "ℹ️";
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 14px;
    color: #2196F3;
    opacity: 0.8;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.tutorial-table-header.highlight {
    background-color: rgba(33, 150, 243, 0.15) !important;
    outline: 3px solid #2196F3 !important;
}

/* Disable standard table hover when in tutorial mode */
.tutorial-element:hover,
.tutorial-element:focus,
.tutorial-element.highlight {
    z-index: 10 !important;
    position: relative !important;
}

/* Tutorial indicator for column headers */
table th.tutorial-element::before {
    top: 2px;
    right: 2px;
}

table th.tutorial-element:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* Tooltip positioning for table headers */
.tutorial-tooltip[data-for-table-header="true"] {
    z-index: 2000 !important;
}

/* Mobile responsiveness for tutorial */
@media (max-width: 768px) {
    .tutorial-tooltip {
        max-width: 250px;
        padding: 15px;
    }
    
    #tutorial-mode-btn {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Nested tutorial elements handling */
.tutorial-element[data-is-nested-tutorial="true"] {
    /* Adjust the indicator position for nested elements to avoid overlap */
    position: relative;
}

.tutorial-element[data-is-nested-tutorial="true"]::before {
    /* Move the indicator for nested elements to avoid overlap */
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    opacity: 0.6;
}

/* Improve z-index handling for nested elements */
.tutorial-element {
    position: relative;
    z-index: 5;
}

.tutorial-element.highlight {
    z-index: 15 !important;
}

.tutorial-element:hover {
    z-index: 10;
}

/* Make sure table headers are still clickable in tutorial mode */
table th.tutorial-element {
    pointer-events: auto !important;
}

/* Prevent unwanted highlighting */
.tutorial-tooltip * {
    pointer-events: auto !important;
}

/* Make sure close button is always clickable */
.tutorial-tooltip .btn {
    position: relative;
    z-index: 2050;
    pointer-events: auto !important;
}

/* Ensure tooltips are positioned above all content */
.tutorial-tooltip {
    z-index: 2040 !important;
}

/* Add escape message to tooltips */
.tutorial-tooltip::after {
    content: "Press ESC to close";
    display: block;
    text-align: center;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
} 