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

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Page transition animations */
body {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

body.fade-out {
    opacity: 0;
    pointer-events: none;
}

main {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

/* Loading overlay */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.page-loading.active {
    opacity: 1;
    pointer-events: all;
}

.page-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal Styles */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

/* Quill Editor Styles */
.quill-editor-container {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
}

.quill-editor-container .ql-container {
    min-height: 300px;
    font-size: 1rem;
}

.quill-editor-container .ql-editor {
    min-height: 300px;
}

.quill-editor-container .ql-toolbar {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    border-bottom: 1px solid #d1d5db;
}

.quill-editor-container .ql-container {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Quill Content Display (read-only) */
.quill-content {
    line-height: 1.75;
}

.quill-content h1,
.quill-content h2,
.quill-content h3,
.quill-content h4,
.quill-content h5,
.quill-content h6 {
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.quill-content h1 { font-size: 2em; }
.quill-content h2 { font-size: 1.5em; }
.quill-content h3 { font-size: 1.25em; }

.quill-content p {
    margin-bottom: 1em;
}

.quill-content ul,
.quill-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.quill-content blockquote {
    border-left: 4px solid #f59e0b;
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    color: #6b7280;
}

.quill-content code {
    background: #f3f4f6;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.9em;
}

.quill-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1em;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1em 0;
}

.quill-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.quill-content a {
    color: #f59e0b;
    text-decoration: underline;
}

.quill-content a:hover {
    color: #d97706;
}

.quill-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1em 0;
}

.quill-content video {
    max-width: 100%;
    border-radius: 0.5rem;
    margin: 1em 0;
}

/* Footer Toggle Styles */
#main-footer.collapsed {
    margin-top: 0;
    padding: 0;
    min-height: 0;
    height: 0;
    overflow: hidden;
}

#main-footer.collapsed #footer-content {
    display: none !important;
}

#footer-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 9999px;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

#footer-toggle:hover {
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.4);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

#footer-toggle:active {
    transform: scale(0.95);
}

#footer-toggle-icon {
    transition: transform 0.3s ease;
}

#main-footer.collapsed #footer-toggle-icon {
    transform: rotate(180deg);
}

@media (max-width: 640px) {
    #footer-toggle {
        width: 2.5rem;
        height: 2.5rem;
        bottom: 0.75rem;
        right: 0.75rem;
    }
    
    #footer-toggle i {
        font-size: 0.875rem;
    }
}

