:root {
    --primary-color: #4e54c8;
    --primary-color-dark: #3a3f9d; /* Darker shade for hover effects */
    --secondary-color: #8f94fb;
    --dark-color: #1a1a2e;
    --light-color: #f5f5f5;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --navbar-height: 60px; /* Define navbar height */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    min-height: 100vh;
    padding-top: var(--navbar-height); /* Add padding for fixed navbar */
}

.navbar { /* Ensure navbar height is consistent */
    min-height: var(--navbar-height);
}

.navbar-brand {
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.navbar-brand span {
    color: var(--secondary-color);
}

.main-container {
    height: calc(100vh - var(--navbar-height) - 40px); /* Height accounts for navbar and footer */
    overflow: hidden;
    display: flex; /* Use flex for workspace */
}

.workspace {
    display: flex; /* Use flex for vertical layout */
    flex-direction: column; /* Stack preview and chat */
    flex-grow: 1; /* Take remaining space */
    height: 100%;
    overflow: hidden;
}

/* Tablet-specific styles (between 641px and 991px) */
@media (min-width: 641px) and (max-width: 991px) {
    /* Force row layout for all workspace variations */
    .workspace, .workspace-horizontal {
        flex-direction: row !important; /* Side-by-side layout on tablets */
    }
    
    /* Fix for workspace-left-column taking too much space */
    .workspace-left-column, .workspace-horizontal .workspace-left-column {
        width: 40% !important; /* Force 40% width */
        min-width: 40% !important; /* Override min-width */
        max-width: 40% !important; /* Override max-width */
        flex: 0 0 40% !important; /* Don't grow or shrink */
    }
    
    /* Fix chat container */
    .chat-container, .workspace-horizontal .chat-container {
        width: 100% !important; /* Take full width of the left column */
        height: 100% !important; /* Full height */
        border-right: none !important; /* Remove border as it's on the column */
    }
    
    /* Fix preview container */
    .preview-container, .workspace-horizontal .preview-container {
        width: 60% !important; /* Take 60% of the width */
        height: 100% !important; /* Full height */
        flex: 1 !important; /* Allow it to grow */
        border-bottom: none !important; /* Remove bottom border in horizontal layout */
    }
    
    /* Fix design options panel */
    .design-options-panel {
        width: 240px !important; /* Slightly smaller on tablets */
        flex: 0 0 240px !important; /* Don't grow or shrink */
    }
    
    /* Ensure main container properly handles the design panel */
    .main-container {
        display: flex !important;
        flex-direction: row !important;
    }
}

/* New horizontal layout for desktop */
@media (min-width: 992px) {
    .workspace-horizontal {
        flex-direction: row; /* Side by side on desktop */
    }

    .workspace-left-column {
        display: flex;
        flex-direction: column;
        width: 30%; /* Smaller width */
        min-width: 280px;
        max-width: 40%; /* Lower maximum width */
        border-right: 1px solid #e0e0e0;
        overflow: hidden;
        position: relative; /* For the resize handle */
    }
}

.preview-container {
    flex-grow: 1; /* Allow preview to take available vertical space */
    background-color: #eee; /* Slightly change background to see iframe bounds */
    border-bottom: 1px solid #e0e0e0;
    overflow: auto; /* Allow scrolling if iframe is too tall */
    position: relative;
    display: flex; /* Use flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: flex-start; /* Align to the top instead of center */
    padding: 1rem; /* Add some padding around the iframe */
}

/* For horizontal layout */
@media (min-width: 992px) {
    .workspace-horizontal .preview-container {
        border-bottom: none; /* Remove bottom border in horizontal layout */
        width: 65%; /* Increased width */
        flex-grow: 1; /* Allow it to grow and take available space */
    }

    .workspace-horizontal .chat-container {
        flex-basis: 60%; /* Take 60% of the left column */
        flex-grow: 1;
    }

    /* Resize handle style */
    .resize-handle {
        position: absolute;
        right: -3px;
        top: 0;
        bottom: 0;
        width: 6px;
        background-color: transparent;
        cursor: col-resize;
        z-index: 100;
    }

    .resize-handle:hover,
    .resizing .resize-handle {
        background-color: var(--primary-color);
        opacity: 0.3;
    }

    /* Prevent text selection during resize */
    .resizing {
        user-select: none;
        cursor: col-resize;
    }
}

/* Assets container styles */
.assets-container {
    background-color: #fff;
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    overflow-y: auto;
    flex-basis: 40%; /* Take 40% of the left column */
}

.assets-container h5 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.assets-container h6 {
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--dark-color);
}

.preview-iframe {
    /* Width is set by JS */
    height: calc(100% - 50px); /* Adjust height to account for topbar */
    max-width: 100%; /* Prevent overflow */
    border: 1px solid #ccc; /* Add border to see iframe */
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1); /* Add shadow for visibility */
    margin-top: 50px; /* Add margin to account for the topbar */
    overflow-y: auto; /* Allow scrolling within the iframe */
    display: block; /* Ensure it's a block element */
}

/* Chat Header Styling */
.chat-header {
    min-height: 45px; /* Give it a minimum height */
    flex-shrink: 0; /* Prevent header from shrinking */
}

 .chat-container {
     background-color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1; /* Take all available space */
    flex-shrink: 0; /* Prevent shrinking */
    height: 100%; /* Full height */
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 1rem;
    max-width: 90%;
}

/* Container for messages */
.messages-wrapper {
    width: 100%;
}

.user-message {
    margin-left: auto;
    background-color: var(--primary-color);
    color: white;
    border-radius: 1rem 1rem 0 1rem;
    padding: 0.75rem 1rem;
}

.bot-message {
    background-color: #e9ecef;
    border-radius: 1rem 1rem 1rem 0;
    padding: 0.75rem 1rem;
}

.chat-input {
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
}

.chat-input textarea { /* Changed from input to textarea */
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    outline: none;
    resize: none; /* Prevent manual resizing */
    min-height: 80px; /* Double the height */
    max-height: 150px; /* Optional: Set a max height */
    overflow-y: auto; /* Allow scrolling if content exceeds height */
    line-height: 1.5; /* Improve readability */
}

.chat-input #sendBtn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.chat-input #clearChatBtn {
    background-color: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
    border-radius: 0.5rem;
    padding: 0.5rem;
    width: 40px;
    transition: all 0.2s ease;
}

.chat-input #clearChatBtn:hover {
    background-color: #f0f0f0;
    color: #495057;
}

.chat-input #sendBtn:hover {
    background-color: var(--primary-color-dark, #0056b3);
}

.framework-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 0.4rem;
    width: 100%; /* Ensure it stays within container */
    box-sizing: border-box; /* Include padding in width calculation */
}

.framework-btn {
    border: 1px solid #ced4da;
    border-radius: 0.4rem;
    padding: 0.3rem 0.5rem;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center; /* Center text */
    font-size: 0.8rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50px; /* Smaller height */
    overflow: hidden; /* Prevent text overflow */
    word-break: break-word; /* Break long words */
}

.framework-btn:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    white-space: normal; /* Allow text to wrap */
    width: 180px; /* Fixed width */
    text-align: center;
    z-index: 1000;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none; /* Prevents the tooltip from interfering with clicks */
}

/* Add arrow to tooltip */
.framework-btn:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%) rotate(180deg); /* Rotate to point up */
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
    z-index: 1001;
    margin-bottom: 5px;
}

.framework-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translateY(-2px); /* Slight lift effect */
}

.settings-group {
    margin-bottom: 1.5rem;
}

.settings-group h5 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.api-settings {
    margin-top: auto;
}

.preview-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 0.5rem;
    background-color: rgba(248, 249, 250, 0.95); /* Lighter, more professional background */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.preview-topbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px; /* Limit width on very large screens */
}

/* Responsive controls on the left */
.responsive-controls {
    display: flex;
    gap: 0.25rem;
}

/* Preview controls on the right */
.preview-controls {
    display: flex;
    gap: 0.25rem;
}

/* Keep old classes for backward compatibility */
.preview-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 0.5rem;
    background-color: rgba(248, 249, 250, 0.95);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.preview-controls-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Unified button styling for all preview controls */
.preview-toolbar .btn-outline-secondary {
    color: #495057; /* Darker text for better contrast */
    border-color: #dee2e6; /* Lighter border */
    background-color: #fff;
    transition: all 0.2s ease;
}

.preview-toolbar .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    color: #212529;
    border-color: #ced4da;
}

.preview-toolbar .btn-outline-secondary:focus,
.preview-toolbar .btn-outline-secondary:active,
.preview-toolbar .btn-outline-secondary.active {
    background-color: #e9ecef;
    color: #212529;
    border-color: #ced4da;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.15);
}

/* Special styling for toggle buttons in active state */
.preview-toolbar .responsive-btn.active {
    background-color: #e9ecef;
    color: #212529;
}

/* Hover effect for all buttons */
.preview-toolbar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 3px rgba(0,0,0,0.05);
}

/* Styling for the edit mode button */
#toggleEditModeBtn {
    background-color: #dc3545; /* Orange background when not active */
    color: white; /* White text for better contrast */
    border-color: #dc3545; /* Slightly darker orange for border */
    border-radius: 0.25rem; /* Match Bootstrap's default button border-radius */
    transition: all 0.2s ease;
}

#toggleEditModeBtn:hover {
    background-color: #e68a00; /* Darker orange on hover */
    color: white;
    border-color: #cc7a00;
    transform: translateY(-1px);
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

/* Specific styling for the edit mode button when active */
#toggleEditModeBtn.active {
    background-color: #28a745; /* Green background when active */
    color: white; /* White text for better contrast */
    border-color: #218838; /* Slightly darker green for border */
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); /* Green glow for focus */
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animated-fade {
    animation: fadeIn 0.3s ease-in;
}

.btn-export {
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    transition: all 0.2s;
}

.btn-export:hover {
    opacity: 0.9;
}

/* Ensure AI provider settings visibility is handled correctly */
.ai-provider-settings.d-none {
    display: none !important; /* Ensure d-none overrides */
}

/* Shared design options container */
.shared-design-options-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh; /* Limit to viewport height */
    overflow: hidden; /* Prevent overflow */
    position: relative; /* Ensure proper stacking */
}

/* Make design-options-scrollable take full available height */
.design-options-scrollable {
    flex: 1;
    overflow-y: auto !important; /* Changed from scroll to auto */
    padding: 1rem;
    height: auto; /* Changed from 100% to auto */
    max-height: none; /* Remove max-height limitation */
    padding-bottom: 200px; /* Extra padding at the bottom to ensure all content is accessible */
    overscroll-behavior: contain; /* Improve scrolling behavior */
}

/* Modal specific styles */
.modal-dialog-scrollable .modal-content {
    max-height: none;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* Navbar Centering Styles */
.navbar .container-fluid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-section {
    display: flex;
    align-items: center;
}

/* On large screens, allow start/end sections to take space */
@media (min-width: 992px) { /* Corresponds to navbar-expand-lg */
    .navbar-section {
        display: flex; /* Ensure flex properties apply */
        align-items: center; /* Align items vertically */
    }
    .navbar-section.start {
        justify-content: flex-start;
        flex: 1; /* Allow start section to push center */
    }
    .navbar-section.end {
        justify-content: flex-end;
        flex: 1; /* Allow end section to push center */
    }
    .navbar-brand.mx-auto {
        flex: 0 1 auto; /* Don't let brand grow/shrink, use auto basis */
    }
}

/* On smaller screens, default flex behavior works */

/* Error Message Styling */
.error-message {
    background-color: #f8d7da !important; /* Light red background */
    color: #721c24 !important; /* Dark red text */
    border-color: #f5c6cb !important; /* Reddish border */
    display: flex; /* Align text and button */
    justify-content: space-between; /* Push button to the right */
    align-items: center; /* Vertically align */
}

.retry-btn {
    /* Adjust spacing if needed */
    margin-left: 0.5rem;
}

/* Desktop Design Options Panel */
.design-options-panel {
    width: 280px; /* Adjust width as needed */
    flex-shrink: 0; /* Prevent shrinking */
    padding: 0;
    border-right: 1px solid #e0e0e0;
    background-color: #fff;
    height: 100%; /* Fill vertical space */
    max-height: 100vh; /* Limit to viewport height */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent overflow */
    position: relative; /* Ensure proper stacking */
}

.design-options-panel h5 {
     margin-bottom: 1rem;
     font-weight: 600;
     color: var(--dark-color);
}



/* Scrollable content area */
.design-options-scrollable {
    flex: 1;
    overflow-y: scroll !important; /* Force scrollbar to always be visible */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    padding-bottom: 200px; /* Extra padding at the bottom to ensure last items are visible */
    height: 100%; /* Ensure it takes full height */
    overscroll-behavior: contain; /* Improve scrolling behavior */
}

/* Fixed update button at bottom */
.design-update-button {
    padding: 0.75rem 1rem;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 10; /* Ensure it stays above other content */
    width: 100%;
}

/* Image and URL Asset Styling */
.image-asset-entry, .url-asset-entry {
    background-color: #f8f9fa; /* Light background */
}

.image-asset-entry .input-group-text, .url-asset-entry .input-group-text {
    width: 35px; /* Fixed width for icons */
    justify-content: center;
}



/* Shared Assets Container Styling */
.shared-assets-container {
    /* Common styles for both mobile and desktop */
    max-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px; /* Add padding at the bottom to ensure last items are visible */
}

/* Make URL and Image containers scrollable when they have many entries */
#urlAssetsContainer, #imageAssetsContainer {
    overflow-y: auto;
    margin-bottom: 10px;
    position: relative; /* Ensure proper stacking context */
    flex-shrink: 0; /* Prevent container from shrinking */
}

/* Make framework buttons more compact */
.framework-selection .framework-btn {
    min-height: auto; /* Auto height to fit content */
    padding: 0.4rem 0.5rem; /* Match our new padding */
    margin-bottom: 0.25rem; /* Slightly increased margin for wrapped text */
}

.framework-selection .framework-list {
    gap: 0.25rem; /* Keep the same gap */
    padding: 0; /* Remove padding */
    margin-top: 0.25rem; /* Add a small top margin instead */
}

/* Ensure accordions don't cause layout issues */
.accordion-collapse {
    overflow: visible !important; /* Ensure content is visible when expanded */
}

.accordion-body {
    padding: 0.5rem 0.5rem 0.25rem 0.5rem !important; /* Further reduce padding */
}

/* Specifically reduce padding for frameworks accordion */
#frameworksCollapse .accordion-body {
    padding: 0.25rem 0.25rem 0 0.25rem !important; /* Minimal padding */
}

/* Ensure the frameworks section is visible */
#frameworksCollapse {
    max-height: none !important; /* Remove any height restrictions */
    overflow: visible !important; /* Ensure content is visible */
}

/* Style for h6 inside accordion buttons */
.accordion-button h6 {
    margin: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Ensure the scrollbar is visible and usable */
#urlAssetsContainer::-webkit-scrollbar,
#imageAssetsContainer::-webkit-scrollbar {
    width: 8px;
}

#urlAssetsContainer::-webkit-scrollbar-thumb,
#imageAssetsContainer::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

#urlAssetsContainer::-webkit-scrollbar-track,
#imageAssetsContainer::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Mobile/Tablet Design Panel is now a Modal - CSS removed */


/* Notification Styles */
.notification-container {
    position: fixed;
    bottom: 20px; /* Position at bottom right */
    right: 20px;
    z-index: 9999; /* Higher than modals and other elements */
    width: 300px; /* Adjust width as needed */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.notification {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    opacity: 0.95;
    animation: notificationFadeIn 0.5s ease-out, notificationFadeOut 0.5s ease-in 2.5s forwards; /* 3s total duration default */
    position: relative; /* For close button positioning */
}

.notification-close {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
}
.notification-close:hover {
    opacity: 1;
}


.notification-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.notification-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.notification-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.notification-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

@keyframes notificationFadeIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 0.95;
        transform: translateX(0);
    }
}

@keyframes notificationFadeOut {
    from {
        opacity: 0.95;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Footer Styles */
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    z-index: 1000;
    padding: 0 20px;
    text-align: center;
}



/* Make the body and html take full height without scrolling */
html, body {
    height: 100%;
    overflow: hidden;
}

/* Keep all of these CSS rules intact */
.framework-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 0.4rem;
    width: 100%; /* Ensure it stays within container */
    box-sizing: border-box; /* Include padding in width calculation */
}

.framework-btn {
    border: 1px solid #ced4da;
    border-radius: 0.4rem;
    padding: 0.3rem 0.5rem;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center; /* Center text */
    font-size: 0.8rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50px; /* Smaller height */
    overflow: hidden; /* Prevent text overflow */
    word-break: break-word; /* Break long words */
}

/* Keep all tooltip-related CSS */
.framework-btn:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    white-space: normal; /* Allow text to wrap */
    width: 180px; /* Fixed width */
    text-align: center;
    z-index: 1000;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none; /* Prevents the tooltip from interfering with clicks */
}

/* Keep arrow tooltip CSS */
.framework-btn:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%) rotate(180deg); /* Rotate to point up */
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
    z-index: 1001;
    margin-bottom: 5px;
}

/* Keep active state styling */
.framework-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translateY(-2px); /* Slight lift effect */
}

/* Ideas/Action Mode Toggle */
.ideas-action-toggle {
    margin-bottom: 0.75rem;
}

.mode-switch-group {
    border-radius: 0.5rem;
    overflow: hidden;
}

.mode-btn {
    flex: 1;
    padding: 0.5rem 0;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}

.ideas-btn {
    background-color: #f8f9fa;
    color: #495057;
}

.ideas-btn.active {
    background-color: #ffcc00;
    color: #212529;
    border-color: #e6b800;
    box-shadow: 0 0 0 0.15rem rgba(255, 204, 0, 0.25);
}

.action-btn {
    background-color: #f8f9fa;
    color: #495057;
}

.action-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color-dark);
    box-shadow: 0 0 0 0.15rem rgba(78, 84, 200, 0.25);
}

/* Loading Animation for AI Response */
.loading-animation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-animation .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pro Activation Styles */
.upgrade-pro-btn {
    display: inline-block;
    text-align: center;
    background-color: #006400; /* Dark green */
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    margin-left: 5px; /* Reduced margin to be closer to the title */
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: relative;
    top: -1px; /* Slight adjustment to align with text */
    order: 1; /* Ensure it appears right after the text */
}

.upgrade-pro-btn:hover {
    background-color: #008000; /* Brighter green on hover */
    transform: scale(1.05);
    color: white;
    text-decoration: none;
}

#proActivationModal .modal-header {
    background-color: #ffc107;
    color: #000;
}

#proLoadingModal .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* New Framework Button Styles - Overrides previous styles */
/* ====================================================== */

/* Global override for all framework lists - this will take precedence */
.framework-list,
.framework-selection .framework-list,
.accordion-body .framework-list,
#frameworksCollapse .framework-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
    margin-bottom: 0.75rem !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
}

/* New compact framework button layout */
.framework-btn {
    border: 1px solid #e0e0e0;
    border-radius: 0.3rem;
    padding: 0.35rem 0.4rem;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    position: relative;
    display: flex !important; /* Force flex display */
    flex-direction: row !important; /* Force row layout */
    align-items: flex-start !important; /* Align to top for wrapped text */
    justify-content: flex-start !important; /* Align to start */
    min-height: auto; /* Auto height to fit content */
    height: auto; /* Auto height to fit content */
    overflow: visible; /* Show all content */
    text-align: left !important; /* Force left text alignment */
    margin-bottom: 0.2rem; /* Small margin between buttons */
}

/* Text content container */
.framework-btn .framework-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    overflow: visible;
    padding: 0.1rem 0; /* Add slight vertical padding */
}

/* Framework name with icon inline */
.framework-btn .framework-name {
    font-weight: 600;
    margin-bottom: 0.1rem;
    color: #333;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Icon styling within the name */
.framework-btn .framework-name i {
    color: var(--primary-color);
    font-size: 1rem;
    margin-right: 0.35rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

/* Framework description */
.framework-btn .framework-desc {
    font-size: 0.65rem; /* Even smaller font size */
    color: #666;
    white-space: normal; /* Allow text to wrap */
    overflow: visible; /* Show all content */
    line-height: 1.2; /* Slightly increased line height for readability */
    padding-left: 0.2rem; /* Minimal left padding for more text space */
    width: 100%; /* Use full width */
    box-sizing: border-box;
    margin-top: 0.1rem; /* Small space between name and description */
    word-wrap: break-word; /* Break long words if needed */
}

/* Active state for the new button layout */
.framework-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.framework-btn.active .framework-name,
.framework-btn.active .framework-name i,
.framework-btn.active .framework-desc {
    color: white;
}

/* Hover state */
.framework-btn:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.framework-btn.active:hover {
    background-color: var(--primary-color-dark);
}

/* Remove old tooltip behavior and replace with new one */
.framework-btn:hover::before,
.framework-btn:hover::after {
    display: none;
}

/* Loading Spinner Animation */
.loading-animation {
    display: flex;
    align-items: center; /* Vertically align text and spinner */
    gap: 8px; /* Space between text and spinner */
}

.loading-animation i {
    font-style: italic; /* Keep text italic */
}

.loading-spinner {
    width: 16px; /* Spinner size */
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1); /* Light grey border */
    border-radius: 50%;
    border-top-color: var(--primary-color); /* Use primary color for the spinning part */
    animation: spin 1s ease-in-out infinite;
    flex-shrink: 0; /* Prevent spinner from shrinking */
}

/* Keyframes for the spin animation (if not already defined elsewhere) */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
