/* Gallery specific styles */
.gallery-container {
    padding: 10px 0;
}

.gallery-search {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.gallery-search input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    min-width: 200px;
}

.gallery-search button {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.gallery-search button:hover {
    background: var(--color-accent-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.gallery-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-image-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-image-wrapper img {
    transform: scale(1.05);
}

.gallery-item-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-item-filename {
    font-size: 0.85rem;
    color: var(--color-text-light);
    word-break: break-all;
    margin-bottom: 10px;
}

.gallery-tags {
    margin-top: auto;
}

.tag {
    display: inline-flex;
    align-items: center;
    background: #f1f3f5;
    color: #495057;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    margin-right: 5px;
    margin-bottom: 5px;
    border: 1px solid transparent;
}

.tag-ai {
    border-color: #dee2e6;
    background: #f8f9fa;
    color: var(--color-accent);
}

.tag-manual {
    background: #e7f5ff;
    color: #1971c2;
}

.tag-delete {
    color: #adb5bd;
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
}

.tag-delete:hover {
    color: #e03131;
}

.tag-edit-form {
    display: flex;
    margin-top: 15px;
    border-top: 1px solid var(--color-border);
    padding-top: 15px;
    gap: 5px;
}

.tag-edit-form input {
    flex-grow: 1;
    font-size: 0.8rem;
    padding: 5px 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.tag-edit-form button {
    background: #f1f3f5;
    border: 1px solid var(--color-border);
    padding: 0 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Modal / Lightbox */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.gallery-modal-content {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
}

.gallery-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

.gallery-modal-caption {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
}

.btn-ai-index {
    background: #6741d9 !important;
}

.btn-ai-index:hover {
    background: #5f3dc4 !important;
}
