@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
    --bg-white: #ffffff;
    --text-black: #2c2c2c;
    --soft-white: #f5f5f7;
    --accent-blue: #3498db;
    --accent-purple: #8e44ad;
    --border-light: #e0e0e0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-black);
    line-height: 1.6;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.chat-section {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.chat-container {
    background-color: var(--soft-white);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin: 20px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 15px;
    border-radius: 10px;
    line-height: 1.5;
    position: relative;
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    margin-left: auto;
}

.bot-message {
    align-self: flex-start;
    background: rgba(240,240,240,0.7);
    color: var(--text-black);
    margin-right: auto;
}

.message img.generated-image {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 10px;
}

.chat-input-area {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: var(--soft-white);
    border-top: 1px solid var(--border-light);
    gap: 10px;
}

#user-input {
    width: 100%;
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-black);
    padding: 10px;
    border-radius: 8px;
    min-height: 100px;
    resize: none;
    transition: border-color 0.3s ease;
}

#user-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.chat-buttons button {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-buttons button:hover {
    transform: scale(1.05);
}

.chat-buttons button.loading {
    cursor: not-allowed;
    opacity: 0.7;
}

.loader {
    display: none;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

.chat-buttons button.loading .loader {
    display: block;
}

.chat-buttons button.loading .btn-text {
    visibility: hidden;
}

.image-gallery {
    flex: 1;
    background: var(--soft-white);
    padding: 20px;
    overflow-y: auto;
    border-left: 1px solid var(--border-light);
}

.image-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.image-carousel img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.image-carousel img:hover {
    transform: scale(1.05);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#slideshow-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#slideshow-btn:hover {
    transform: scale(1.05);
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.image-modal .modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    animation: zoom-in 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.slideshow-modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.slideshow-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slideshow-container img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    animation: fade-in 0.5s ease;
}

.slideshow-controls {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.slideshow-controls button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.slideshow-controls button:hover {
    background: rgba(255,255,255,0.4);
}

.close-slideshow {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes zoom-in {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}