/* glassmorphism.css from doc *//* assets/css/glassmorphism.css */

/* Base Glassmorphism Effect */
.glass-morphism {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    position: relative;
}

.glass-morphism::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
}

/* Glass Input Effect */
.glass-input {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
    transition: all var(--transition-fast) ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: var(--red-500) !important;
    box-shadow: 
        0 0 0 3px rgba(220, 38, 38, 0.1),
        0 4px 12px rgba(220, 38, 38, 0.15) !important;
}

.dark-mode .glass-input {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
}

.dark-mode .glass-input:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--red-400) !important;
}

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

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

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    max-width: 800px;
    border-radius: 1rem;
    overflow: hidden;
    animation: scaleIn 0.3s ease;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(220, 38, 38, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.btn-close {
    padding: 0.5rem;
    background: none;
    border: none;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--red-600);
}

.modal-body {
    padding: 1.5rem;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* History Grid */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.history-item {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all var(--transition-normal) ease;
    position: relative;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(220, 38, 38, 0.15),
        var(--glass-shadow);
}

.history-image {
    aspect-ratio: 1;
    overflow: hidden;
}

.history-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal) ease;
}

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

.history-info {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
}

.history-prompt {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.625rem;
}

.history-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-normal) ease;
}

.history-item:hover .history-actions {
    opacity: 1;
}

.history-actions button {
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.history-actions button:hover {
    background: rgba(220, 38, 38, 0.8);
    transform: scale(1.1);
}

/* Custom Scrollbar for Modal */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--red-500), var(--red-600));
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--red-600), var(--red-700));
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 120px);
    }
    
    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.75rem;
    }
    
    .history-info {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .history-grid {
        grid-template-columns: 1fr;
    }
}
