@font-face {
    font-family: 'Daydream';
    src: url('Daydream.ttf') format('truetype');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    min-height: 100vh;
    padding: 2rem;
    color: #333;
    background-attachment: fixed;
}

.container {
    /* max-width: 1200px; */
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

h1, h2 {
    font-family: 'Daydream', sans-serif;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #6a11cb;
    text-shadow: 2px 2px 4px rgba(106, 17, 203, 0.2);
}

h1 {
    font-size: 3rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    letter-spacing: 1px;
}

p {
    text-align: center;
    margin-bottom: 2rem;
    color: #555;
    font-size: 1.1rem;
    line-height: 1.5;
}

.app-layout {
    display: flex;
    gap: 2.5rem;
    flex-wrap: nowrap;
}

.input-panel, .inputs-panel-images {
    flex: 1;
    min-width: 25%;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    border: 1px solid rgba(106, 17, 203, 0.1);
    box-shadow: 0 8px 20px rgba(106, 17, 203, 0.1);
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(106, 17, 203, 0.1);
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #555;
    font-weight: 500;
}

.slider-value {
    font-weight: bold;
    color: #6a11cb;
    min-width: 30px;
    text-align: right;
    font-size: 1.2rem;
    background: rgba(106, 17, 203, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.insanity-slider {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #6a11cb, #2575fc, #ff4d4d, #ff8c00);
    border-radius: 10px;
    outline: none;
}

.insanity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #6a11cb;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.insanity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.insanity-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #6a11cb;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.insanity-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.insanity-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.insanity-marker {
    position: relative;
    width: 2px;
    height: 8px;
    background-color: rgba(106, 17, 203, 0.5);
}

.insanity-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
}

.insanity-description {
    text-align: center;
    font-size: 0.95rem;
    margin-top: 12px;
    font-style: italic;
    color: #6a11cb;
    min-height: 45px;
    padding: 8px;
    background: rgba(106, 17, 203, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(106, 17, 203, 0.2);
}

.seed-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(106, 17, 203, 0.1);
}

.seed-label {
    color: #555;
    flex-shrink: 0;
    font-weight: 500;
}

.seed-input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #ccc;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    color: #6a11cb;
    transition: all 0.2s ease;
    background: white;
}

.seed-input:focus {
    border-color: #6a11cb;
    outline: none;
    box-shadow: 0 0 10px rgba(106, 17, 203, 0.3);
}

.seed-random {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.prompt-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(106, 17, 203, 0.1);
}

.prompt-label {
    color: #555;
    font-weight: 500;
}

.custom-prompt {
    width: 100%;
    min-height: 90px;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 10px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.custom-prompt:focus {
    border-color: #6a11cb;
    outline: none;
    box-shadow: 0 0 10px rgba(106, 17, 203, 0.3);
}

.result-panel {
    flex: 1.5;
    min-width: 350px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    border: 1px solid rgba(106, 17, 203, 0.1);
    box-shadow: 0 8px 20px rgba(106, 17, 203, 0.1);
}

.upload-box {
    height: 220px;
    border: 3px dashed rgba(106, 17, 203, 0.4);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.2rem;
}

.upload-box:hover {
    border-color: #6a11cb;
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(106, 17, 203, 0.2);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    z-index: 1;
}

.upload-icon {
    fill: #6a11cb;
    margin-bottom: 1rem;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.merge-button {
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    box-shadow: 0 8px 20px rgba(106, 17, 203, 0.3);
    letter-spacing: 1px;
    font-family: 'Daydream', sans-serif;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.merge-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.merge-button:hover:not(:disabled)::before {
    left: 100%;
}

.merge-button:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(106, 17, 203, 0.4);
}

.merge-button:disabled {
    background: linear-gradient(135deg, #ccc 0%, #ddd 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.result-container {
    margin-top: 2rem;
}

.result-box {
    border: 2px solid rgba(106, 17, 203, 0.2);
    border-radius: 15px;
    overflow: hidden;
    min-height: 75px;
    max-height: 95%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 0 20px rgba(106, 17, 203, 0.08);
    position: relative;
}

.result-image {
    min-width: 100%;
    width: auto;
    height: -webkit-fill-available;
    max-height: none;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#previousResultImage {
    display: none !important; /** Come back to this in the future and impliment the needed js code to allow the #resultImage element's [@src] to pass to #previousResultImage element's [@src] whenever the "generateMergedImage(prmpt)" function has successfully completed and is ready to update the #resultImage element's [@src] with the new resulting url. */
}

.copy-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(106, 17, 203, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    opacity: 0.9;
    z-index: 10;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.copy-button:hover {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.copy-button svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.copy-button.success {
    background: #4CAF50;
}

.favorite-button {
    position: absolute;
    top: 15px;
    right: 150px;
    background: rgba(106, 17, 203, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    opacity: 0.9;
    z-index: 10;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.favorite-button:hover {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.favorite-button.favorited svg {
    fill: #FFD700;
}

.favorite-button svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 6px solid rgba(106, 17, 203, 0.1);
    border-top: 6px solid #6a11cb;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.hidden {
    display: none;
}

.favorites-panel {
    /* max-width: 1200px; */
    margin: 2.5rem auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.favorites-panel h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #6a11cb;
}

.favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(25%, 1fr));
    gap: 2rem;
}

.favorite-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    transform-origin: center;
}

.favorite-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.favorite-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.favorite-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.8rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    backdrop-filter: blur(2px);
}

.favorite-date {
    font-style: italic;
}

.remove-favorite {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.remove-favorite:hover {
    opacity: 1;
    color: #ff4d4d;
}

.music-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
    align-items: center;
}

.music-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(106, 17, 203, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.music-button:hover {
    transform: scale(1.1);
    background: rgba(106, 17, 203, 1);
}

.music-button svg {
    fill: white;
}

.music-button.muted svg path {
    d: path("M4.27 3L3 4.27l9 9v.28c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4v-1.73L19.73 21 21 19.73 4.27 3zM14 7h4V3h-6v5.18l2 2z");
}

.volume-slider {
    width: 100px;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #ffffff, #ffffff);
    border-radius: 10px;
    outline: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.music-controls:hover .volume-slider {
    opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #6a11cb;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #6a11cb;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.shared-images-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.shared-image-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.shared-image-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.shared-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.shared-by {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.8rem;
    font-size: 0.9rem;
    backdrop-filter: blur(2px);
}

.share-button {
    position: absolute;
    top: 15px;
    right: 260px;
    background: rgba(106, 17, 203, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    opacity: 0.9;
    z-index: 10;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.share-button:hover {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.share-button svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.shared-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 90%;
    width: 800px;
    padding: 25px;
    position: relative;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6a11cb;
}

.modal-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 20px;
}

.sources-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.source-image {
    width: 48%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #6a11cb;
}

.modal-details {
    background: rgba(106, 17, 203, 0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(106, 17, 203, 0.2);
}

.detail-item {
    margin-bottom: 10px;
}

.detail-label {
    font-weight: bold;
    color: #6a11cb;
}

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

.mobile-mode-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(106, 17, 203, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    z-index: 100;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.mobile-mode-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.mobile-mode-button svg {
    width: 18px;
    height: 18px;
    fill: white;
}

body.mobile-mode .container,
body.mobile-mode .favorites-panel {
    max-width: 100%;
    padding: 1.5rem;
}

body.mobile-mode .app-layout {
    flex-direction: column;
}

body.mobile-mode .copy-button, 
body.mobile-mode .favorite-button,
body.mobile-mode .share-button {
    position: static;
    margin: 0.5rem;
    display: inline-flex;
}

body.mobile-mode .result-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

body.mobile-mode h1 {
    font-size: 2rem;
}

body.mobile-mode h2 {
    font-size: 1.5rem;
}

body.mobile-mode .result-box {
    flex-direction: column;
}

.result-actions {
    display: none;
}

body.mobile-mode .result-actions {
    display: flex;
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .copy-button, .favorite-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .favorite-button {
        right: 120px;
    }
    .share-button {
        right: 200px;
    }
}