body,
html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    height: 100%;
    background-color: #f0f0f0;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column; /* Add this to stack header and content vertically */
    height: calc(100% - 100px); /* Subtract margin from total height */
    overflow: auto; /* Changed from overflow-y: auto */
    -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
    scrollbar-width: none;  /* Hide scrollbar for Firefox */
    margin-bottom: 100px;
    padding-bottom: 100px; /* Add padding to ensure content isn't cut off */
}

header {
    background-color: #333;
    color: white;
    display: flex;
    justify-content: flex-start;
    position: sticky;
    top: 0;
    width: 100%;
    align-items: center;
    padding: 0 2rem;
    height: 74px;
    border-bottom: 2px solid #ff7f50;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    gap: 2rem; /* Add gap between header elements */
}

/* Ensure proper header layout */
header .logo {
    flex-shrink: 0;
    order: 1; /* Logo comes first */
}

header .modern-dropdown {
    flex-shrink: 0;
    order: 2; /* Dropdown comes second (left side after logo) */
    margin-left: 0; /* Reset margin-left */
    margin-right: 0; /* Reset margin-right */
}

header .nav-links {
    flex-shrink: 1; /* Allow shrinking */
    order: 3; /* Nav links come third (to the right of dropdown) */
    margin-left: 0; /* Reset margin-left */
    margin-right: 0; /* Reset margin-right */
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 7px 0; /* Add padding to prevent image from touching header edges */
}

.logo img {
    width: 250px;
    height: 60px; /* Set fixed height instead of auto */
    object-fit: contain;
    margin: auto 0; /* Add this for vertical centering */
}

button {
    background-color: #ff7f50;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 10px;
    max-width: 250px;
}

.modern-dropdown {
    margin-bottom: 15px;
    margin-left: 0; /* Remove left margin for header positioning */
    margin-right: 0; /* Remove right margin for header positioning */
}

.modern-dropdown select,
.modern-dropdown input[type="text"] {
    width: 10%;
    padding: 10px;
    margin-bottom: 10px;
}

/* Style modern-dropdown in header context */
header .modern-dropdown {
    margin-bottom: 0; /* Remove bottom margin in header */
    display: flex;
    align-items: center;
    min-width: fit-content;
}

.buttons {
    display: flex;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    align-items: center;
    justify-content: flex-start; /* Left align the nav links */
    scrollbar-width: thin;
    /* scrollbar-color: #ff7f50 #222; */
    max-width: calc(100vw - 600px); /* Adjusted for positioning after dropdown */
    min-width: 0; /* Allow shrinking */
    flex: 1; /* Take available space */
    padding: 0 10px; /* Add padding for better spacing */
}

/* Modern, rounded, thin scrollbar for Webkit browsers */
.nav-links::-webkit-scrollbar {
    height: 6px;
    background: rgba(34, 34, 34, 0.3);
    border-radius: 8px;
}

.nav-links::-webkit-scrollbar-thumb {
    background: #ff7f50;
    border-radius: 8px;
    min-width: 30px;
    transition: background-color 0.2s ease;
}

.nav-links::-webkit-scrollbar-thumb:hover {
    background: #ff9970;
}

.nav-links::-webkit-scrollbar-track {
    background: rgba(34, 34, 34, 0.1);
    border-radius: 8px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-right: 10px; /* Changed from margin-left to margin-right */
    padding: 12px 20px; /* Slightly increased padding */
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500; /* Slightly bolder text */
    position: relative;
}

.nav-links a:hover {
    background-color: rgba(255, 127, 80, 0.2);
    color: #ff7f50;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 127, 80, 0.3);
}

.nav-links a:active {
    transform: translateY(0);
}

/* Add active/current link styling */
.nav-links a.active {
    background-color: rgba(255, 127, 80, 0.3);
    color: #ff7f50;
    font-weight: 600;
}

/* Responsive adjustments for different screen sizes */
@media (max-width: 1200px) {
    .nav-links {
        max-width: calc(100vw - 550px);
    }
}

@media (max-width: 1024px) {
    header {
        padding: 0 1.5rem;
        gap: 1.5rem;
    }
    
    .nav-links {
        max-width: calc(100vw - 500px);
    }
    
    .nav-links a {
        padding: 10px 16px;
        font-size: 14px;
        max-width: 150px;
    }
    
    .logo img {
        width: 200px;
        height: 50px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0 1rem;
        gap: 1rem;
    }
    
    .nav-links {
        max-width: calc(100vw - 400px);
        padding: 0 5px;
    }
    
    .nav-links a {
        padding: 8px 14px;
        font-size: 13px;
        margin-right: 8px;
        max-width: 120px;
    }
    
    .logo img {
        width: 180px;
        height: 45px;
    }
    
    /* Make dropdown more compact on tablets */
    header .modern-dropdown {
        scale: 0.9;
    }
}

@media (max-width: 640px) {
    header {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }
    
    .nav-links {
        max-width: calc(100vw - 350px);
    }
    
    .nav-links a {
        padding: 6px 12px;
        font-size: 12px;
        margin-right: 6px;
        max-width: 100px;
    }
    
    .logo img {
        width: 150px;
        height: 40px;
    }
    
    /* Further compact dropdown */
    header .modern-dropdown {
        scale: 0.8;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0 0.5rem;
        gap: 0.5rem;
        flex-wrap: nowrap; /* Prevent wrapping */
    }
    
    .nav-links {
        max-width: calc(100vw - 300px);
        padding: 0;
    }
    
    .nav-links a {
        padding: 6px 10px;
        font-size: 11px;
        margin-right: 4px;
        max-width: 80px;
        border-radius: 4px;
    }
    
    .logo img {
        width: 120px;
        height: 35px;
    }
    
    /* Very compact dropdown for mobile */
    header .modern-dropdown {
        scale: 0.7;
    }
    
    /* Show scroll indicators on very small screens */
    .nav-links::before {
        content: '';
        position: sticky;
        left: 0;
        width: 20px;
        height: 100%;
        background: linear-gradient(to right, rgba(51, 51, 51, 0.8), transparent);
        pointer-events: none;
        z-index: 1;
    }
    
    .nav-links::after {
        content: '';
        position: sticky;
        right: 0;
        width: 20px;
        height: 100%;
        background: linear-gradient(to left, rgba(51, 51, 51, 0.8), transparent);
        pointer-events: none;
        z-index: 1;
    }
}

/* Enhanced scrollbar visibility on mobile */
@media (max-width: 640px) {
    .nav-links::-webkit-scrollbar {
        height: 8px;
        background: rgba(255, 255, 255, 0.1);
    }
    
    .nav-links::-webkit-scrollbar-thumb {
        background: #ff7f50;
        border-radius: 4px;
        min-width: 40px;
    }
}

.username {
    font-weight: bold;
    color: #be5d0d;
    margin-right: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 17px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 17px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 13px;
    width: 13px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

input:checked + .slider {
    background-color: #ff7f50;
}

input:checked + .slider:before {
    transform: translateX(13px);
}

.content-box {
    background-color: rgb(255, 255, 255);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(255, 102, 0, 0.1);
    width: 100%;
    max-width: 1000px;
    height: 60vh;
    overflow: visible;
    margin-top: 2rem;
}

.model-selection {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.model-selection select {
    flex: 2;
}

.model-selection button {
    flex: 1;
}

.prompt-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 20px auto;
}

.prompt-editor {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    padding: 20px;
}

.prompt-content {
    width: 100%;
    min-height: 250px;
    padding: 15px;
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
    background-color: #fff;
    border: none;
    resize: none;
    outline: none;
    height: 500px;   
    overflow: scroll;
    scrollbar-width: thin;
    scrollbar-color: #ff7f50 #f0f0f0;
    -ms-overflow-style: auto;
}

.prompt-content[contenteditable="true"] {
    display: block;
    white-space: pre-line;
    overflow-wrap: break-word;
    overflow-y: auto;
    word-wrap: break-word;
    word-break: break-word;
}

/* Placeholder style */
.prompt-content:empty:before {
    content: "Enter your prompt here...";
    color: #999;
}

/* Custom scrollbar */
.prompt-content::-webkit-scrollbar {
    width: 8px;
}

.prompt-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.prompt-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.prompt-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #ff7f50;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    margin: 12px 0;
    padding: 0;
    width: fit-content;
}
  
.typing-bubble {
    background-color: #f0f0f0;
    border-radius: 18px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
  
.typing-dots {
    display: flex;
    align-items: center;
}
  
.typing-dot {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: #9e9e9e;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.8;
    animation: typingBounce 1.4s infinite ease-in-out both;
}
  
.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}
  
.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}
  
@keyframes typingBounce {
    0%, 80%, 100% { 
        transform: scale(0.8);
    }
    40% { 
        transform: scale(1.2);
    }
}
  
/* Responsive styles for typing indicator */
@media (max-width: 480px) {
    .typing-bubble {
        padding: 8px 12px;
        border-radius: 16px;
    }
    
    .typing-dot {
        height: 6px;
        width: 6px;
        margin: 0 1px;
    }
}

.progress-wrapper {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    pointer-events: none;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: rgba(247, 37, 133, 0.4);
    transition: width 0.3s linear;
}

.secondary-header {
    margin-top: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 40px;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

/* File deletion animations and styles */
.file-item {
    position: relative;
    transition: all 0.3s ease;
}

.file-item.deleting {
    pointer-events: none;
    opacity: 0.7;
    transform: scale(0.95);
    background-color: rgba(255, 0, 0, 0.1) !important;
    border: 2px solid #ff4444;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.file-item.deleting::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 0, 0, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    z-index: 1;
}

.file-item.deleting .file-content {
    position: relative;
    z-index: 2;
}

.file-item.deleting .button-container-icons {
    opacity: 0.5;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes deleteSlideOut {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-20px) scale(0.95);
        opacity: 0.5;
    }
    100% {
        transform: translateX(-100%) scale(0.8);
        opacity: 0;
    }
}

.file-item.delete-complete {
    animation: deleteSlideOut 0.5s ease-in-out forwards;
}

/* Loading overlay for deletion */
.deletion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.deletion-overlay.active {
    opacity: 1;
    visibility: visible;
}

.deletion-spinner {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeInUp 0.3s ease;
}

.deletion-spinner i {
    font-size: 2rem;
    color: #ff4444;
    animation: spin 1s linear infinite;
}

.deletion-spinner p {
    margin: 15px 0 0 0;
    color: #333;
    font-weight: 500;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Disable interactions during deletion */
body.deletion-in-progress {
    pointer-events: none;
    user-select: none;
}

body.deletion-in-progress * {
    pointer-events: none !important;
}

body.deletion-in-progress .deletion-overlay {
    pointer-events: auto;
}

/* File item hover effects */
.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.file-item.deleting:hover {
    transform: scale(0.95);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

/* Progress bar for deletion */
.deletion-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 0 0 8px 8px;
}

.file-item.deleting .deletion-progress {
    animation: progressFill 2s ease-in-out;
}

@keyframes progressFill {
    0% {
        width: 0%;
    }
    50% {
        width: 60%;
    }
    100% {
        width: 100%;
    }
}