:root {
    --primary-color: #6a0dad;
    --secondary-color: #ff6b6b;
    --accent-color: #00d4b8;
    --background-color: #1a1a2e;
    --text-color: #ffffff;
    --sidebar-bg: #2d2d44;
    --card-bg: #2e2e48;
    --prompt-bg: rgba(0, 0, 0, 0.5);
}

/* Import additional fonts for better readability */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;700&family=Audiowide&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Loading Modal */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeOut 0.5s ease-in-out 3s forwards;
}

.progress-container {
    width: 300px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    border-radius: 10px;
    transition: width 0.1s linear;
}

.progress-emoji {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    font-size: 16px;
    transition: left 0.1s linear;
}

.loading-modal img {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 3px solid var(--accent-color);
}

.loading-modal h2 {
    font-family: 'Press Start 2P', cursive;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 20px;
    animation: pulse 1s infinite alternate;
}

.desktop-notice {
    color: var(--accent-color);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-align: center;
}

@keyframes fadeOut {
    from { opacity: 1; visibility: visible; }
    to { opacity: 0; visibility: hidden; }
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.banner {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 2px solid var(--accent-color);
}

.banner-overlay h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.5rem;
    color: #ffffff;
    text-shadow: 3px 3px 0 var(--primary-color),
                 5px 5px 0 rgba(0, 0, 0, 0.7);
    margin-bottom: 5px;
    letter-spacing: 2px;
    text-align: center;
}

.banner-overlay h2.subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.banner-overlay p.tagline {
    font-family: 'Audiowide', cursive;
    font-size: 1.3rem;
    color: var(--accent-color);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    margin-bottom: 5px;
}

.banner-overlay p.author-credit {
    margin-top: 5px;
    font-size: 1.1rem;
}

.banner-overlay p {
    font-family: 'Audiowide', cursive;
    font-size: 1.5rem;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.banner-overlay a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}

.banner-overlay a:hover {
    color: var(--accent-color);
}

.container {
    display: flex;
    min-height: calc(100vh - 200px - 60px);
}

.sidebar {
    width: 300px;
    background-color: var(--sidebar-bg);
    padding: 20px 15px;
    border-right: 3px solid var(--accent-color);
    overflow-y: auto;
    max-height: calc(100vh - 200px - 60px);
    transition: max-height 0.3s ease;
}

.search-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.nav-link {
    flex: 1;
    background-color: var(--sidebar-bg);
    color: var(--text-color);
    text-align: center;
    padding: 10px 5px;
    text-decoration: none;
    border-radius: 5px;
    margin: 0 5px;
    transition: background-color 0.3s, transform 0.3s;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-link:first-child {
    margin-left: 0;
}

.nav-link:last-child {
    margin-right: 0;
}

.nav-link.active, .nav-link:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.config-count-small {
    font-size: 0.7em;
    color: var(--accent-color);
    font-weight: normal;
    font-family: 'Orbitron', sans-serif;
    vertical-align: middle;
}
.nav-link i {
    margin-right: 5px;
}

.download-configs-btn {
    display: block;
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 15px;
    transition: background-color 0.3s, transform 0.3s;
    font-family: 'Orbitron', sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.random-config-btn {
    display: block;
    background-color: var(--accent-color);
    color: white;
    text-align: center;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 15px;
    transition: background-color 0.3s, transform 0.3s;
    font-family: 'Orbitron', sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.random-config-btn:hover {
    background-color: #00b09b;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.download-configs-btn:hover {
    background-color: #ff4f4f;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.download-configs-btn i {
    margin-right: 8px;
}

.search-input-container {
    display: flex;
    margin-bottom: 10px;
}

#search-input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border-radius: 5px 0 0 5px;
    font-family: 'Orbitron', sans-serif;
}

#search-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
}

#reset-search-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-family: 'Orbitron', sans-serif;
}

#reset-search-button:hover {
    background-color: #ff4f4f;
}

.sidebar-content h2 {
    font-family: 'Press Start 2P', cursive;
    color: var(--secondary-color);
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2rem;
}

#config-list {
    list-style-type: none;
    padding: 0;
}

#config-list > li {
    margin-bottom: 5px;
    transition: transform 0.3s;
}

#config-list > li:hover {
    transform: translateX(5px);
}

#config-list > li > a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--primary-color) 0%, transparent 100%);
    transition: background 0.3s;
    font-size: 0.9rem;
}

#config-list > li > a:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, transparent 100%);
    color: white;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

#welcome-message {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-color);
}

#welcome-message h2 {
    font-family: 'Bungee Shade', cursive;
    color: var(--secondary-color);
    margin-bottom: 20px;
    text-align: center;
    font-size: 2rem;
}

.welcome-avatars {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.welcome-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
}

.welcome-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 194, 168, 0.7);
    cursor: pointer;
}

#welcome-message p, #welcome-message ul {
    margin-bottom: 15px;
}

#welcome-message ul {
    padding-left: 20px;
}

#config-display {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-color);
}

.config-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.config-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    margin-right: 20px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.config-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 194, 168, 0.7);
}

.config-title h2 {
    font-family: 'Press Start 2P', cursive;
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.5rem;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.config-section {
    margin-bottom: 30px;
}

.config-section h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent-color);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 5px;
}

.config-section p {
    margin-bottom: 15px;
}


.system-prompt {
    background-color: var(--prompt-bg);
    padding: 15px;
    border-radius: 5px;
    position: relative;
    border-left: 5px solid var(--primary-color);
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.system-prompt pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.5;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 10;
}

.copy-btn-bottom {
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.copy-btn:hover {
    background-color: var(--secondary-color);
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 20px;
    gap: 10px;
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    align-items: center;
}

.action-btn i {
    margin-right: 8px;
}

.action-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* Modal for avatar images */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
}

#modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-family: 'Orbitron', sans-serif;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--secondary-color);
    text-decoration: none;
    cursor: pointer;
}

footer {
    background-color: var(--sidebar-bg);
    color: var(--text-color);
    text-align: center;
    padding: 20px;
    border-top: 3px solid var(--accent-color);
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Animation for the config cards */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#config-display {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        flex-direction: column-reverse;
        min-height: unset;
    }
    
    .sidebar {
        width: 100%;
        max-height: 250px; /* Reduced sidebar height */
        border-right: none;
        border-bottom: 3px solid var(--accent-color);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        z-index: 10;
    }
    
    .sidebar-content {
        padding: 10px 5px 20px;
    }
    
    .sidebar-content h2 {
        font-size: 1rem; /* Reduced heading font size */
        margin-top: 0;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .banner-overlay h1 {
        font-size: 1.5rem;
    }
    
    .banner-overlay h2.subtitle {
        font-size: 1rem;
    }
    
    .banner-overlay p.tagline {
        font-size: 0.9rem;
    }
    
    .banner-overlay p {
        font-size: 1rem;
    }
    
    .header-container {
        margin-bottom: 15px;
    }
    
    .header-avatar {
        margin-bottom: 10px;
        width: 60px;
        height: 60px;
    }
    
    .banner {
        height: 180px;
    }
    
    .config-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .config-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        margin-bottom: 10px;
        justify-content: center;
    }
    
    #welcome-message, #config-display {
        padding: 20px 15px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 90%;
    }
    
    .download-configs-btn {
        padding: 12px 15px;
        font-size: 1rem; /* Reduced font size */
    }
    
    #search-input, #search-button, #reset-search-button {
        padding: 10px 12px; /* Reduced padding */
        font-size: 0.9rem; /* Reduced font size */
    }

    #config-list > li > a {
        padding: 8px; /* Reduced padding */
        margin: 3px 0; /* Reduced margin */
        font-size: 0.85rem; /* Reduced font size */
    }
    
    .loading-modal img {
        width: 200px;
        height: 200px;
    }
    
    .progress-container {
        width: 250px;
    }
    
    .loading-modal h2 {
        font-size: 1.2rem;
        padding: 0 15px;
    }
    
    .desktop-notice {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .welcome-avatars {
        gap: 10px;
    }
    
    .welcome-avatar {
        width: 80px;
        height: 80px;
    }
    
    #welcome-message h2 {
        font-size: 1.5rem;
    }
    
    .system-prompt {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .copy-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    .config-title h2 {
        font-size: 1.2rem;
        text-align: center;
    }
}

/* Additional media query for extra small devices */
@media (max-width: 480px) {
    .banner-overlay h1 {
        font-size: 1.2rem;
    }
    
    .banner-overlay h2.subtitle {
        font-size: 0.9rem;
    }
    
    .banner-overlay p.tagline {
        font-size: 0.8rem;
    }
    
    .banner-overlay p {
        font-size: 0.9rem;
    }
    
    .banner {
        height: 160px;
    }
    
    .header-avatar {
        width: 50px;
        height: 50px;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-link {
        margin: 0;
        padding: 12px 5px;
    }
    
    .search-input-container {
        flex-direction: column;
    }
    
    #search-input {
        border-radius: 5px;
    }
    
    #search-button {
        border-radius: 5px;
        margin-top: 10px;
        width: 100%;
    }
}

/* Add a fixed navigation for mobile */
@media (max-width: 768px) {
    /* Create a fixed mobile navigation */
    /* Mobile navigation at the top */
    .mobile-nav-container {
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
        background-color: var(--sidebar-bg);
        border-bottom: 3px solid var(--accent-color);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-nav {
        display: flex;
        justify-content: space-between;
        padding: 10px;
    }
    
    .mobile-search-bar {
        display: flex;
        padding: 10px;
        background-color: rgba(0, 0, 0, 0.2);
    }
    
    #mobile-search-input {
        flex: 1;
        padding: 12px;
        border: 2px solid var(--primary-color);
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--text-color);
        border-radius: 5px 0 0 5px;
        font-size: 1rem;
    }
    
    #mobile-search-button {
        padding: 12px 15px;
        background-color: var(--primary-color);
        color: white;
        border: none;
        border-radius: 0 5px 5px 0;
        cursor: pointer;
        font-size: 1rem;
    }
    
    #mobile-reset-button {
        padding: 12px 15px;
        background-color: var(--secondary-color);
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 1rem;
        margin-left: 10px;
    }
    
    .mobile-nav-item {
        display: flex;
        align-items: center;
        color: var(--text-color);
        text-decoration: none;
        font-size: 0.9rem;
        padding: 10px;
        border-radius: 5px;
        transition: background-color 0.3s;
    }
    
    .mobile-nav-item i {
        font-size: 1.2rem;
        margin-right: 5px;
    }
    
    .mobile-nav-item:hover, .mobile-nav-item.active {
        background-color: var(--primary-color);
    }
    
    /* Add space at the top for the fixed navigation */
    body {
        padding-top: 0;
    }
    
    /* Hide the original sidebar navigation on mobile */
    .sidebar .nav-links, 
    .sidebar .download-configs-btn,
    .sidebar .search-input-container,
    .sidebar #reset-search-button {
        display: none;
    }
    
    /* Adjust banner for mobile */
    .banner {
        margin-top: 0;
    }
    
    /* Reverse the container order to put sidebar at the bottom */
    .container {
        flex-direction: column;
    }
    
    /* Make sidebar more compact */
    .sidebar {
        width: 100%;
        max-height: 300px;
        border-right: none;
        border-top: 3px solid var(--accent-color);
        overflow-y: auto;
    }
    
    .sidebar-content {
        padding: 10px 5px 20px;
    }
    
    .sidebar-content h2 {
        margin-top: 0;
    }
    
    /* Other mobile optimizations */
    #config-list > li > a, 
    .action-btn,
    .copy-btn {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .config-section {
        margin-bottom: 25px;
    }
    
    .system-prompt {
        line-height: 1.6;
        font-size: 0.95rem;
    }
    
    .modal-close {
        font-size: 50px;
        padding: 10px;
        top: 10px;
    }
    
    .banner-overlay {
        justify-content: flex-start;
        padding-top: 15px;
    }
    
    #welcome-message {
        margin-bottom: 20px;
    }
    
    footer {
        padding: 15px 10px;
        font-size: 0.9rem;
    }
    
    .sidebar, .main-content {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
    
    input, button {
        -webkit-appearance: none;
        appearance: none;
        border-radius: 5px;
    }
    
    html {
        -webkit-text-size-adjust: 100%;
    }
    
    .system-prompt pre {
        font-size: 0.9rem;
    }
    
    a, button {
        -webkit-tap-highlight-color: rgba(106, 13, 173, 0.3);
    }
    
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    .main-content, .sidebar, .banner-overlay, #welcome-message, #config-display {
        overflow-wrap: break-word;
    }

    /* Adjust loading modal for mobile */
    .loading-modal {
        z-index: 2000; /* Ensure it's above the mobile nav */
    }
}
