/* Gallery Page Styles */

/* Search Section */
.search-section {
    background: var(--surface);
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}

.container-full {
    max-width: 100%;
    padding: 0 40px;
    margin: 0 auto;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1rem;
    border: 2px solid var(--primary);
    border-radius: 25px;
    background: var(--background);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.1);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Gallery Section */
.gallery-section {
    padding: 40px 0;
    background: var(--background);
    min-height: 70vh;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    padding: 0;
}

/* Prompt Cards */
.prompt-card {
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 280px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
}

.prompt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.tag {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.card-preview {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 15px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    background: var(--background);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.action-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

.action-btn.success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.full-prompt {
    display: none;
}

/* Modal Styles */
.prompt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--background);
    border: 2px solid var(--primary);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(var(--primary-rgb), 0.2);
    max-width: 900px;
    max-height: 90vh;
    width: 90%;
    position: relative;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 18px 18px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    background: var(--surface);
}

.full-prompt-text {
    background: var(--background);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 25px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    font-family: inherit;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modal-actions {
    display: flex;
    gap: 15px;
    padding: 25px 30px;
    border-top: 2px solid var(--primary);
    justify-content: center;
    background: var(--surface);
    border-radius: 0 0 18px 18px;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1100;
    animation: slideIn 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

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

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsive */
@media (max-width: 1400px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .container-full {
        padding: 0 30px;
    }
}

@media (max-width: 768px) {
    .search-section {
        padding: 30px 0;
    }
    
    .container-full {
        padding: 0 20px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .prompt-card {
        height: 300px;
        padding: 18px;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .search-input {
        padding: 12px 45px 12px 15px;
        font-size: 0.95rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-actions {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .search-section {
        padding: 25px 0;
    }
    
    .container-full {
        padding: 0 15px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .prompt-card {
        height: 320px;
        padding: 16px;
    }
    
    .card-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .action-btn {
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .search-section {
        padding: 20px 0;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-actions .action-btn {
        width: 100%;
    }
}
