/**
 * Bootstrap Override Styles for Nohmi Personal AI Assistant
 * 
 * This file contains custom styles that work alongside Bootstrap 5.3.0
 * to maintain the unique aesthetic of the Nohmi application while
 * leveraging Bootstrap's component system and grid layout.
 */

/* =========================================================
   BOOTSTRAP OVERRIDES & CUSTOM STYLES
   ========================================================= */

/* Maintain our custom gradients */
:root {
    --bs-primary: #667eea;
    --bs-primary-rgb: 102, 126, 234;
    --nohmi-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --nohmi-card-bg: rgba(255, 255, 255, 0.95);
    --nohmi-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Custom header styling (outside Bootstrap grid) */
.header-title {
    background: linear-gradient(45deg, #ffffff, #f0f9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: -0.02em;
}

/* Theme toggle button positioning */
.theme-toggle-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.btn-theme {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    color: white;
}

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

/* Custom card styling with gradients */
.card.nohmi-card {
    background: var(--nohmi-card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.card.nohmi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--nohmi-primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card.nohmi-card:hover::before {
    opacity: 1;
}

.card.nohmi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--nohmi-shadow-lg);
}

/* Stat cards with hover effects */
.stat-card {
    background: var(--nohmi-card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--nohmi-shadow-lg), 0 0 20px rgba(102, 126, 234, 0.3);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--nohmi-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-number {
    transform: scale(1.1);
}

/* Custom button styles with gradients */
.btn-nohmi-primary {
    background: var(--nohmi-primary-gradient);
    border: none;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-nohmi-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-nohmi-primary:hover::before {
    left: 100%;
}

.btn-nohmi-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Memory items styling - Override general card styles */
.memory-item.card {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Disable the general card::before top border for memory items */
.memory-item.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--nohmi-primary-gradient);
    transition: width 0.3s ease;
    opacity: 1; /* Always visible, not like the general card border */
}

.memory-item.card:hover::before {
    width: 8px;
}

.memory-item.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--nohmi-shadow-lg);
}

/* Memory tags */
.memory-tag {
    background: var(--nohmi-primary-gradient);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.memory-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

/* Memory actions - Button animations */
.memory-actions .btn-delete {
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.15s ease;
    padding: 0.25rem 0.5rem;
}

.memory-item:hover .memory-actions .btn-delete {
    opacity: 1;
    transform: translateX(0);
}

/* Search panel with custom styling */
.search-panel-custom {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
}

/* =========================================================
   SKELETON LOADER INTEGRATION
   ========================================================= */

/* Ensure skeleton loaders work well with Bootstrap grid */
.col .skeleton-loader {
    height: 100%;
}

.card .skeleton-loader {
    padding: 1.5rem;
}

/* =========================================================
   PAGINATION BOOTSTRAP OVERRIDES
   ========================================================= */

/* Enhanced Bootstrap pagination with Nohmi theme */
.pagination .page-link {
    color: var(--bs-gray-700);
    background-color: var(--nohmi-card-bg);
    border-color: rgba(255, 255, 255, 0.2);
    transition: all 0.15s ease;
    backdrop-filter: blur(10px);
}

.pagination .page-link:hover {
    color: var(--bs-primary);
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--bs-primary);
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: var(--nohmi-primary-gradient);
    border-color: transparent;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
}

/* =========================================================
   FORM CONTROLS BOOTSTRAP ENHANCEMENT
   ========================================================= */

/* Enhanced form controls with Nohmi theme */
.form-control {
    background: var(--nohmi-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.15s ease;
}

.form-control:focus {
    background: var(--nohmi-card-bg);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

.form-control::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.dark-mode .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* =========================================================
   BADGE BOOTSTRAP OVERRIDES
   ========================================================= */

.badge.nohmi-badge {
    background: var(--nohmi-primary-gradient);
    color: white;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.badge.nohmi-badge-outline {
    background: transparent;
    border: 1px solid var(--bs-primary);
    color: var(--bs-primary);
}

/* Dark mode adjustments */
.dark-mode {
    --nohmi-card-bg: rgba(26, 32, 44, 0.95);
    --bs-body-bg: #1a202c;
    --bs-body-color: #f7fafc;
}

.dark-mode .card.nohmi-card {
    background: var(--nohmi-card-bg);
    border-color: #4a5568;
}

.dark-mode .stat-card {
    background: var(--nohmi-card-bg);
    border-color: #4a5568;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-toggle-container {
        position: static;
        text-align: center;
        margin-top: 1rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

/* Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* Global fade-in animation for the page */
.container-fluid {
    animation: fadeIn 0.8s ease-out;
}
