/* Main Styles for AI Dream */

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Navbar Customization */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

/* Social Icons Styling */
.nav-item.socials {
    display: flex;
    align-items: center;
}

.nav-item.socials .nav-link {
    padding: 0.5rem 0.7rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.nav-item.socials .nav-link:hover {
    color: #fff;
    transform: translateY(-2px);
}

.nav-item.socials .fa-facebook:hover {
    color: #4267B2;
}

.nav-item.socials .fa-youtube:hover {
    color: #FF0000;
}

.nav-item.socials .fa-tiktok:hover {
    color: #69C9D0;
}

/* Main Card Styling */
.main-card {
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: none;
    overflow: hidden;
}

/* Style Selection Buttons */
.btn-style {
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-style:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-style.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Gallery Cards */
.gallery-card {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    height: 100%;
    position: relative;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gallery-card .image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 133.33%; /* 4:3 aspect ratio */
}

.gallery-card img {
    /*position: absolute;*/
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card .card-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px;
    color: white;
}

.gallery-card .card-text {
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* 标准属性，提供更好的浏览器兼容性 */
    -webkit-box-orient: vertical;
}

/* Modal Styling */
#imageModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#imageModal .modal-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 20px;
    text-align: left;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#imageModal .modal-body img {
    max-height: 400px;
    object-fit: contain;
    /* margin-right: 20px; */
    flex: 0 0 50%;
    padding: 0 5px;
}

#imageModal .modal-body .image-description {
    flex: 0 0 50%;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

#imageModal .modal-body .image-description p {
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#imageModal .modal-body .image-description .btn {
    margin-bottom: 10px;
    width: auto;
    min-width: 120px;
    margin-right: 10px;
    display: inline-block;
}

@media (max-width: 768px) {
    #imageModal .modal-body {
        flex-direction: column;
    }
    
    #imageModal .modal-body img {
        margin-right: 0;
        margin-bottom: 15px;
        flex: 0 0 100%;
        width: 100%;
    }
    
    #imageModal .modal-body .image-description {
        flex: 0 0 100%;
        padding-left: 0;
    }
}

/* Footer Styling */
footer {
    border-top: 1px solid #e9ecef;
}

/* Generated Image Container */
#generatedImageContainer {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

#generatedImageContainer img {
    border-radius: 8px;
    transition: transform 0.3s ease;
}

#generatedImageContainer img:hover {
    transform: scale(1.02);
}

#generatedImageContainer .btn {
    border-radius: 8px;
    padding: 10px 16px;
    transition: all 0.3s ease;
}

#generationSuccess {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.15);
    animation: fadeInDown 0.5s;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Aspect Select Styling */
.aspect-select-container {
    width: 300px;
}

.aspect-select-container label {
    white-space: nowrap;
    margin-right: 15px;
}

.aspect-select-container .form-select {
    min-width: 150px;
    flex: 1;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.aspect-select-container .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .gallery-card img {
        height: 200px;
    }
    
    .options {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .options .d-flex {
        margin-top: 15px;
        width: 100%;
    }
    
    .options .d-flex button {
        flex: 1;
    }
    
    .btn-style {
        margin-bottom: 8px;
    }
    
    #generatedImageContainer .row {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .gallery-card img {
        height: 180px;
    }
    
    .style-selection .d-flex {
        justify-content: center;
    }
}

.gallery-card {
    position: relative;
    overflow: hidden;
}
.gallery-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-card:hover .gallery-actions {
    opacity: 1;
}
.gallery-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.gallery-action-btn:hover {
    background-color: #fff;
    transform: scale(1.1);
}