/* public/css/admin/blog-form.css */

/* ===== QUILL EDITOR STYLES ===== */
.ql-editor {
    min-height: 250px;
    font-size: 14px;
    line-height: 1.6;
}

.ql-toolbar {
    border-top: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #f9fafb;
}

.ql-container {
    border-bottom: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    font-family: inherit;
}

.ql-snow .ql-tooltip {
    z-index: 1000;
}

/* Focus styles */
.quill-focus .ql-toolbar {
    border-color: #6366f1;
}

.quill-focus .ql-container {
    border-color: #6366f1;
}

/* Custom toolbar button styles */
.ql-snow .ql-toolbar button:hover,
.ql-snow .ql-toolbar button:focus {
    color: #6366f1;
}

.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button.ql-active:hover {
    color: #6366f1;
}

/* ===== FORM STYLES ===== */
.gallery-item {
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.image-preview-container {
    position: relative;
    overflow: hidden;
}

.image-preview-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 45%, rgba(99, 102, 241, 0.1) 50%, transparent 55%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.image-preview-container:hover::before {
    transform: translateX(100%);
}

/* ===== TAB STYLES ===== */
.tab-btn {
    transition: all 0.2s ease;
}

.tab-btn:not(.active):hover {
    background-color: rgba(99, 102, 241, 0.05);
    color: #6366f1;
}

/* ===== LANGUAGE TOGGLE ANIMATIONS ===== */
.lang-en, .lang-vi {
    transition: opacity 0.2s ease;
}

/* ===== FORM FIELD ENHANCEMENTS ===== */
.form-field-group {
    position: relative;
}

.form-field-group input:focus + .field-icon,
.form-field-group textarea:focus + .field-icon {
    color: #6366f1;
}

/* Character counter styles */
.character-counter {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    transition: color 0.2s ease;
}

.character-counter.warning {
    color: #f59e0b;
}

.character-counter.error {
    color: #ef4444;
}

/* ===== TOAST ANIMATIONS ===== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-enter {
    animation: slideInRight 0.3s ease-out forwards;
}

.toast-exit {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* ===== LOADING STATES ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .ql-toolbar {
        padding: 8px;
    }
    
    .ql-toolbar .ql-formats {
        margin-right: 8px;
    }
    
    .gallery-item {
        width: 100%;
        max-width: 200px;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.tab-btn:focus,
.image-tab-btn:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ql-toolbar {
        border-color: #000;
    }
    
    .ql-container {
        border-color: #000;
    }
}