/* Custom Styles for Physics Knowledge Base */

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

/* Tables */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 6px;
}

/* Formula Display */
.formula-display {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.katex-display {
    margin: 1rem 0;
}

/* Article Content */
.article-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.article-content h1, 
.article-content h2, 
.article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

/* Problem Cards */
.problem-card {
    margin-bottom: 20px;
}

.problem-answer {
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 6px;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.problem-answer:hover {
    background-color: #e9ecef;
    border-color: #007bff;
}

.problem-answer.correct {
    background-color: #d4edda;
    border-color: #28a745;
}

.problem-answer.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
}

/* Constants Table */
.constants-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.constants-table td, 
.constants-table th {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Category Colors */
.category-mechanics { border-left: 4px solid #007bff; }
.category-thermodynamics { border-left: 4px solid #dc3545; }
.category-electricity { border-left: 4px solid #ffc107; }
.category-optics { border-left: 4px solid #28a745; }
.category-nuclear { border-left: 4px solid #6f42c1; }

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Search Bar */
.search-bar {
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-bar input {
    border-radius: 25px;
    padding: 12px 24px;
    border: 2px solid #e9ecef;
}

.search-bar input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Footer */
footer {
    background-color: #343a40;
    color: white;
    padding: 30px 0;
    margin-top: 50px;
}

footer a {
    color: #adb5bd;
    text-decoration: none;
}

footer a:hover {
    color: white;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
}

/* Code blocks */
pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
}

code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .article-content {
        font-size: 1rem;
    }
}

/* Animation for page transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* TinyMCE content styling */
.mce-content-body {
    padding: 15px;
}

/* Image upload preview */
.image-preview {
    max-width: 100%;
    max-height: 300px;
    margin-top: 10px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

/* Statistics cards on dashboard */
.stat-card {
    text-align: center;
    padding: 25px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-card .stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
