/* Custom styles for Učiteljka app */

/* Root variables for consistent theming */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Body and general styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.dropdown-menu {
    z-index: 1055 !important;
    position: absolute !important;
}

.card:has([data-bs-toggle="dropdown"]):hover {
    transform: none !important;
}

/* Prevent card hover transform from affecting dropdown position */
.card.dropdown-open:hover {
    transform: none;
}

/* Navigation enhancements */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover {
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

/* Card enhancements */
.card {
    border: none;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.2);
    font-weight: 600;
}

/* Statistics cards */
.card.bg-primary,
.card.bg-success,
.card.bg-info {
    border: none;
    transition: all 0.3s ease;
}

.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
}

/* Quick action buttons */
.btn-outline-primary,
.btn-outline-success {
    transition: all 0.3s ease;
    border-width: 2px;
}

.btn-outline-primary:hover,
.btn-outline-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Form styling */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Button enhancements */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    border: none;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(21, 115, 71, 0.1) 100%);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(187, 45, 59, 0.1) 100%);
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1) 0%, rgba(11, 172, 204, 0.1) 100%);
    border-left: 4px solid var(--info-color);
}

/* List group styling */
.list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    padding-left: 1.5rem;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Empty state styling */
.text-muted {
    color: #6c757d !important;
}

/* Footer styling */
footer {
    margin-top: auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .form-control:focus {
        transform: none;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 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-out;
}

/* Print styles */
@media print {
    .navbar,
    footer,
    .btn,
    .alert {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* WYSIWYG Editor Styles */
.wysiwyg-container {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.wysiwyg-container:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.wysiwyg-container.is-invalid {
    border-color: #dc3545;
}

.wysiwyg-container.is-invalid:focus-within {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Quill Editor Customization */
.ql-toolbar.ql-snow {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #ced4da;
    border-radius: 0.375rem 0.375rem 0 0;
    background-color: #f8f9fa;
}

.ql-container.ql-snow {
    border: none;
    border-radius: 0 0 0.375rem 0.375rem;
    font-family: inherit;
    font-size: 1rem;
}

.ql-editor {
    min-height: 150px;
    padding: 0.75rem;
}

.ql-editor.ql-blank::before {
    color: #6c757d;
    font-style: italic;
}

/* Lesson plan content styling */
.lesson-plan-content {
    line-height: 1.6;
}

.lesson-plan-content h1,
.lesson-plan-content h2,
.lesson-plan-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.lesson-plan-content h1 {
    font-size: 1.5rem;
    color: #0d6efd;
}

.lesson-plan-content h2 {
    font-size: 1.25rem;
    color: #0d6efd;
}

.lesson-plan-content h3 {
    font-size: 1.1rem;
    color: #6f42c1;
}

.lesson-plan-content ul,
.lesson-plan-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.lesson-plan-content li {
    margin-bottom: 0.25rem;
}

.lesson-plan-content a {
    color: #0d6efd;
    text-decoration: underline;
    font-weight: 500;
}

.lesson-plan-content a:hover {
    color: #0a58ca;
    text-decoration: none;
}

.lesson-plan-content strong {
    font-weight: 600;
    color: #212529;
}

.lesson-plan-content em {
    font-style: italic;
    color: #6c757d;
}

/* Make sure links open in new tab */
.lesson-plan-content a[href^="http"]::after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
}

/* Custom toolbar button styling */
.ql-toolbar .ql-formats {
    margin-right: 1rem;
}

.ql-toolbar .ql-formats:last-child {
    margin-right: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ql-toolbar .ql-formats {
        margin-right: 0.5rem;
        margin-bottom: 0.25rem;
    }
    
    .ql-editor {
        min-height: 120px;
        padding: 0.5rem;
    }
}