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

/* Sidebar Styles */
.sidebar {
    position: sticky;
    top: 20px;
}

.sidebar .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.sidebar .btn {
    border-radius: 8px;
    font-weight: 500;
}

/* Membership plan buttons: default yellow, darken on focus/active */
.btn-plan {
    background-color: #ffc107; /* bootstrap warning */
    color: #212529;
    border: none;
}
.btn-plan:hover,
.btn-plan:focus,
.btn-plan:active {
    background-color: #e0a800; /* darken */
    color: #212529;
}

/* Content Area */
.content-area {
    min-height: 80vh;
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 5px;
    margin-bottom: 20px;
}

.image-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0.5rem; /* tighter vertical spacing without changing image size */
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.image-item img {
    width: 100%;
    height: 200px; /* keep thumbnail size */
    object-fit: cover;
    border-radius: 0px;
}

/* Image loading overlay */
.image-loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 关键：回退自身宽高的一半 */
    /*     background: rgba(255, 255, 255, 0.6); */
    padding: 1rem;
    border-radius: 8px;
    text-align: center;

    /* 使用 flex 让内部内容也居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    opacity: 1;
    transition: opacity 0.2s ease;
    pointer-events: none;

}

.image-item img.is-loaded + .image-loading-overlay,
.image-item img.error + .image-loading-overlay {
    opacity: 0;
    visibility: hidden;
}

.image-prompt {
    padding: 10px;
    background: rgba(255,255,255,0.9);
    border-radius: 0 0 10px 10px;
}

/* Generation Groups */
.generation-group {
    background: white;
    border-radius: 12px;
    padding: 16px; /* slightly tighter */
    box-shadow: 0 3px 16px rgba(0,0,0,0.06);
    border: 1px solid #e9ecef;
}

.generation-header {
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 15px;
}

.generation-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.generation-actions .btn {
    font-size: 0.8rem;
    padding: 4px 8px;
}

.generation-info {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 10px; /* tighter */

}



/* Generation Form */
.generation-form .card {
    border: none;
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.generation-form .card-header {
    border-radius: 5px 5px 0 0 !important;
}

.generation-form textarea {
    resize: vertical;
    min-height: 100px;
}

.generation-form .btn {
    border-radius: 5px;
    font-weight: 600;
    padding: 12px 30px;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Cards */
.card {
    border: none;
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.card-header {
    border-radius: 5px 5px 0 0 !important;
    border-bottom: none;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: bold;

}

.nav-link:hover {
    color:white;

}

/* Dropdown */
.dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 8px 8px;
}

.dropdown-item {
    border-radius: 8px;

    padding: 8px 16px;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #A8f9fa;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Footer */
footer {
    margin-top: auto;
}

footer a {
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
    }
    
    .generation-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .generation-actions .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .generation-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .images-grid {
        grid-template-columns: 1fr;
    }
    
    .generation-group {
        padding: 15px;
    }
    
    .demo-images-container {
        padding: 20px;
    }
}

/* Loading States */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Utility Classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.box-shadow-hover {
    transition: box-shadow 0.3s ease;
}

.box-shadow-hover:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.border-radius-lg {
    border-radius: 5px;
}

.border-radius-xl {
    border-radius: 10px;
}

/* Image Grid Styles */
.image-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem; /* tighter column/row gap */
	margin-bottom: 1.25rem; /* tighter section spacing */
}

@media (max-width: 1200px) {
	.image-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
	.image-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
	.image-grid { grid-template-columns: 1fr; }
}

.image-item {
	background: white;
	border-radius: 5px;
	padding: 1rem;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	transition: all 0.3s ease;
}

.image-item:hover {
	transform: translateY(-5px);
	box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.image-item img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	border-radius: 0px;
}

.image-prompt {
	padding: 0.5rem;
	background: #f8f9fa;
	border-radius: 5px;
	margin-top: 0.5rem;
}

/* Image Modal Styles */
.modal-xl { max-width: 90%; }
.modal-xl .modal-body { padding: 2rem; }
.modal-xl .modal-body img { max-width: 100%; max-height: 80vh; object-fit: contain; }

/* Active dropdown item */
.dropdown-item.active { background-color: #007bff; color: white; }
.dropdown-item.active:hover { background-color: #0056b3; }

/* Floating Left Menu */
.floating-left-menu {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 1050;
	width: 64px;
	background: rgba(0,0,0,0.6);
	backdrop-filter: blur(6px);
	border-radius: 12px;
	padding: 12px 8px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.floating-left-menu .menu-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #fff;
	text-decoration: none;
	padding: 8px 0;
	border-radius: 10px;
	transition: background 0.2s ease, transform 0.2s ease;
}

.floating-left-menu .menu-item:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.floating-left-menu .menu-item i { font-size: 18px; }
.floating-left-menu .menu-item span { font-size: 11px; margin-top: 6px; line-height: 1; }

/* Badge on top item (e.g., membership) */
.floating-left-menu .badge-top {
	position: absolute;
	top: -8px;
	right: -8px;
	background: #17a2b8;
	color: #fff;
	border-radius: 10px;
	font-size: 10px;
	padding: 2px 6px;
}
