body {
    font-family: 'Inter', sans-serif;
    color: #1f2937;
    margin: 0;
}

#sidebar {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar-settings-icon-container svg {
    display: none;
}

#sidebar-settings-icon-container::before {
    content: "";
    display: block;
    width: 2rem;
    height: 2rem;
    margin: 0 auto;
    background: url('/picture/logo.png') center / contain no-repeat;
}

#sidebar #expanded-menu {
    opacity: 1;
    visibility: visible;
    overflow-x: hidden;
}

#expanded-menu ul li a span {
    opacity: 0;
    transform: translateX(-25px);
    display: inline-block;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

#sidebar:hover #expanded-menu ul li a span {
    opacity: 1;
    transform: translateX(0);
    transition-property: opacity, transform;
    transition-duration: 0.35s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar:hover #expanded-menu ul li:nth-child(1) a span { transition-delay: 0.20s; }
#sidebar:hover #expanded-menu ul li:nth-child(2) a span { transition-delay: 0.25s; }
#sidebar:hover #expanded-menu ul li:nth-child(3) a span { transition-delay: 0.30s; }
#sidebar:hover #expanded-menu ul li:nth-child(4) a span { transition-delay: 0.35s; }
#sidebar:hover #expanded-menu ul li:nth-child(5) a span { transition-delay: 0.40s; }
#sidebar:hover #expanded-menu ul li:nth-child(6) a span { transition-delay: 0.45s; }

#mainContent {
    transition: margin-left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 4rem;
}

#promptInput {
    resize: none;
    overflow-y: hidden;
    min-height: 50px;
    box-sizing: border-box;
}

#horizontalStylesContainer {
    scrollbar-width: thin;
    scrollbar-color: #a0aec0 #e2e8f0;
    padding-top: 0.25rem;
}
#horizontalStylesContainer::-webkit-scrollbar {
    height: 8px;
}
#horizontalStylesContainer::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}
#horizontalStylesContainer::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 10px;
}
#horizontalStylesContainer::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

.style-item {
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-radius: 0.75rem;
    background-color: white;
    box-sizing: border-box;
}
.style-item:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.style-item.selected {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.35);
}
.style-item img {
    object-fit: cover;
    border-radius: 0.5rem;
    width: 100%;
    height: 100%;
    display: block;
}

.horizontal-style-item {
    flex: 0 0 auto;
    width: 200px;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem;
}
.horizontal-style-item img {
    width: 130px;
    height: 130px;
    margin-bottom: 0.25rem;
}
.horizontal-style-item .style-name {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    color: #374151;
    white-space: normal;
    line-height: 1.3;
    width: 100%;
    max-height: 2.6em;
    overflow: hidden;
}

.all-styles-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
}
.all-styles-list-item:hover {
    background-color: #f3f4f6;
}
.all-styles-list-item img {
    width: 48px;
    height: 48px;
    margin-right: 0.75rem;
}
.all-styles-list-item .style-name {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

#allStylesView.hidden_effectively {
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.3s ease, visibility 0s linear 0.3s, transform 0.3s ease, max-height 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
}
#allStylesView.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: 2000px;
    transition: opacity 0.3s ease, visibility 0s linear 0s, transform 0.3s ease, max-height 0.3s ease-in;
    overflow: auto;
}

.loading-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    width: 100%;
}
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #8A2BE2;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#historyContainer, #myGeneratedImagesContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    #historyContainer, #myGeneratedImagesContainer {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 1280px) {
    #historyContainer, #myGeneratedImagesContainer {
        grid-template-columns: repeat(5, 1fr);
    }
}


.generated-example-item {
    position: relative;
    cursor: pointer;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background-color: #e5e7eb;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.generated-example-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.generated-example-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.generated-example-item .category-tag {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(25, 25, 25, 0.75);
    color: white;
    padding: 0.2rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: 0.375rem;
    z-index: 10;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


#exampleModal.hidden {
    display: none;
}
#exampleModal #closeModalButton {
    font-size: 1.75rem;
}

#toastNotification.hidden {
    display: none !important;
}

#toastNotification.show {
    display: block !important;
    animation: fadeInOut 3s ease-in-out forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

#historyContainer > div:not(.generated-example-item) {
    background-color: #f9fafb;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    grid-column: 1 / -1;
}

@media (max-width: 599px) {
    #sidebar {
        width: 4rem !important;
        transition: none !important;
    }
    #sidebar:hover {
        width: 4rem !important;
    }

    #sidebar #sidebar-settings-icon-container {
        display: block !important;
    }
    #sidebar:hover #sidebar-settings-icon-container {
        display: block !important;
    }

    #sidebar #expanded-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transition: none !important;
    }

    #sidebar #expanded-menu ul li a span {
        display: none !important;
        opacity: 0 !important;
        transform: none !important;
        transition: none !important;
    }
    #sidebar:hover #expanded-menu ul li a span {
        display: none !important;
        opacity: 0 !important;
        transform: none !important;
    }
    #sidebar:hover #expanded-menu ul li:nth-child(1) a span,
    #sidebar:hover #expanded-menu ul li:nth-child(2) a span,
    #sidebar:hover #expanded-menu ul li:nth-child(3) a span,
    #sidebar:hover #expanded-menu ul li:nth-child(4) a span,
    #sidebar:hover #expanded-menu ul li:nth-child(5) a span,
    #sidebar:hover #expanded-menu ul li:nth-child(6) a span {
        transition-delay: 0s !important;
    }

    #sidebar #expanded-menu ul li a {
        justify-content: center !important;
    }
    #sidebar #expanded-menu ul li a svg {
        margin-right: 0 !important;
    }

    #mainContent {
        margin-left: 4rem !important;
        transition: none !important;
    }
}
