/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    z-index: 10000 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast-item {
    min-width: 320px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .12);
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateX(120%);
    transition: all .4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid #0ea5e9;
}

.toast-item.show {
    transform: translateX(0)
}

.toast-item.error {
    border-left-color: #ef4444
}

.toast-item.success {
    border-left-color: #10b981
}

.toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.toast-item.error .toast-icon {
    background: #fef2f2;
    color: #ef4444
}

.toast-item.success .toast-icon {
    background: #f0fdf4;
    color: #10b981
}

.toast-content {
    flex: 1
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 2px
}

.toast-msg {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4
}

.toast-close {
    cursor: pointer;
    color: #94a3b8;
    transition: color .2s
}

.toast-close:hover {
    color: #64748b
}

/* Form Validation States */
.input-wrap.has-success input {
    border-color: #10b981 !important;
    background: #f0fdf4 !important;
}

.input-wrap.has-error input {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

/* ===== GLOBAL PAGE LOADER ===== */
#globalPageLoader {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 999999;
    color: #fff;
    font-family: 'Inter', sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.loader-content {
    text-align: center;
    padding: 50px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
    animation: loader-appear 0.5s ease-out;
}

@keyframes loader-appear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.loader-spinner {
    width: 140px;
    height: 140px;
    position: relative;
    margin: 0 auto 35px;
}

.loader-spinner span {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
}

.loader-spinner span:nth-child(1) {
    border-top-color: #008890;
    border-bottom-color: #008890;
    animation: spin 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-spinner span:nth-child(2) {
    border-left-color: #F37021;
    border-right-color: #F37021;
    width: 100px;
    height: 100px;
    top: 20px;
    left: 20px;
    opacity: 0.8;
    animation: spin-reverse 1.4s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 136, 144, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    z-index: 10;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.loader-logo i {
    color: #008890;
    font-size: 24px;
}

.loader-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, #008890, #F37021, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    display: block;
    margin-top: 15px;
}

.loader-subtext {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes shine {
    to { background-position: 200% center; }
}

@keyframes heartbeat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    15% { transform: translate(-50%, -50%) scale(1.15); }
    30% { transform: translate(-50%, -50%) scale(1); }
    45% { transform: translate(-50%, -50%) scale(1.1); }
    60% { transform: translate(-50%, -50%) scale(1); }
}

/* Hide standard Laravel validation error blocks globally as per request */
/* This ensures all post-validation errors are shown via Toast instead of inline text */
.field-error:not(.js-field-error), 
.alert-block.alert-danger, 
.invalid-feedback,
.alert-danger {
    display: none !important;
}

/* ===== CKEDITOR PREMIUM STYLING & FIXES ===== */
.ck-editor__editable {
    min-height: 200px !important;
    max-height: 500px !important;
    background: #fff !important;
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
    padding: 0 15px !important;
}

.ck.ck-editor {
    position: relative !important;
    z-index: 1 !important; /* Ensure it stays below dropdowns but above background */
    margin-top: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    border-radius: 12px !important;
    overflow: hidden;
}

.ck.ck-toolbar {
    background: #f8fafc !important;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #cbd5e1 !important;
    padding: 5px !important;
}

.ck.ck-editor__main>.ck-editor__editable {
    border: 1px solid #e2e8f0 !important;
    border-top: none !important;
    transition: all 0.3s ease !important;
}

.ck.ck-editor__main>.ck-editor__editable.ck-focused {
    border-color: #008890 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 136, 144, 0.1), 0 4px 6px -2px rgba(0, 136, 144, 0.05) !important;
}

/* Premium Toolbar Buttons */
.ck.ck-toolbar .ck-button {
    border-radius: 8px !important;
    margin: 2px !important;
    transition: all 0.2s ease !important;
}

.ck.ck-toolbar .ck-button:hover {
    background: #e2e8f0 !important;
}

.ck.ck-toolbar .ck-button.ck-on {
    background: #008890 !important;
    color: #fff !important;
}

/* Fix for overlapping labels in some themes */
.form-label, label {
    display: block !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    position: relative !important;
    z-index: 5 !important;
    pointer-events: auto !important;
}

/* Hide the default CKEditor accessibility label if it's being rendered visibly */
.ck.ck-editor__editable_inline[aria-label*="Rich Text Editor"],
.ck-label {
    display: none !important;
}

/* Rich Content Display Wrapper */
.ck-content {
    line-height: 1.8;
    color: #334155;
}

.ck-content p {
    margin-bottom: 1rem;
}

.ck-content ul, .ck-content ol {
    padding-left: 2rem;
    margin-bottom: 1rem;
}
