/* Siaio Content Publishing Design System */
:root {
    /* Premium Color Palette */
    --publish-bg-deep: #050505;
    --publish-surface: rgba(15, 15, 15, 0.8);
    --publish-border: rgba(255, 255, 255, 0.08);
    --publish-border-bright: rgba(255, 255, 255, 0.15);
    
    /* Content Type Colors */
    --color-video: #00f2ff; /* Neon Cyan */
    --color-podcast: #a855f7; /* Royal Purple */
    --color-book: #fbbf24; /* Golden Amber */
    --color-success: #10b981;
    --color-error: #ef4444;
    
    /* Glassmorphism Tokens */
    --glass-blur: 30px;
    --glass-reflection: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 100%);
    --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    
    /* Typography */
    --font-primary: 'Outfit', 'Tajawal', sans-serif;
    --font-size-label: 15px;
    --font-size-title: 24px;
}
/* Modal Overlay Container */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(2, 2, 4, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    z-index: 200000 !important;
    padding: 24px;
    animation: modalFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.modal.show {
    display: flex;
}

/* Glassmorphism Utilities */
.glass-modal {
    background: linear-gradient(135deg, rgba(16, 16, 22, 0.96), rgba(8, 8, 12, 0.99)) !important;
    backdrop-filter: blur(40px) !important;
    -webkit-backdrop-filter: blur(40px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 28px !important;
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Premium Top Gradient Accent Bar for Modals */
.glass-modal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-video), var(--color-podcast), var(--color-book), var(--color-success));
    z-index: 100;
}

.glass-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: 28px;
    background: var(--glass-reflection);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Modal Backdrop */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 199999 !important;
    transition: background 0.3s ease;
}

.modal-overlay.active {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-body.publish-scrollbar {
    max-height: 75vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

#book-writing-area {
    -webkit-overflow-scrolling: touch !important;
}

.close-modal {
    background: rgba(255, 255, 255, 0.05) !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    cursor: pointer !important;
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    transform: rotate(90deg) scale(1.05) !important;
}

.close-modal:hover i {
    color: #ef4444 !important;
}

.close-modal i {
    transition: color 0.3s !important;
}

.upload-drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px !important;
    padding: 50px 30px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    background: rgba(255, 255, 255, 0.01) !important;
    position: relative !important;
    overflow: hidden !important;
}

.upload-drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 242, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.upload-drop-zone:hover {
    border-color: var(--color-video) !important;
    background: rgba(0, 242, 255, 0.02) !important;
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.08) !important;
}

.upload-drop-zone:hover::before {
    opacity: 1;
}

.upload-drop-zone .upload-icon {
    font-size: 48px !important;
    color: var(--color-video) !important;
    margin-bottom: 20px !important;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.upload-drop-zone:hover .upload-icon {
    transform: translateY(-5px) scale(1.1);
    opacity: 1;
}

.glass-surface {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
}

.option-card {
    background: rgba(255, 255, 255, 0.01) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 24px !important;
    padding: 30px !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 18px !important;
    position: relative !important;
    overflow: hidden !important;
}

.option-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
    opacity: 1;
    transition: opacity 0.3s;
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.03) !important;
    transform: translateY(-5px) scale(1.02) !important;
}

.option-card:active {
    transform: translateY(0) scale(0.98) !important;
}

.option-card .icon-box {
    width: 65px;
    height: 65px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.option-card:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

.glow-border-video:hover {
    border-color: var(--color-video) !important;
    box-shadow: 0 15px 30px rgba(0, 242, 255, 0.15), 0 0 0 1px var(--color-video) !important;
}
.glow-border-video:hover .icon-box {
    background: rgba(0, 242, 255, 0.2) !important;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}

.glow-border-podcast:hover {
    border-color: var(--color-podcast) !important;
    box-shadow: 0 15px 30px rgba(168, 85, 247, 0.15), 0 0 0 1px var(--color-podcast) !important;
}
.glow-border-podcast:hover .icon-box {
    background: rgba(168, 85, 247, 0.2) !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.glow-border-book:hover {
    border-color: var(--color-book) !important;
    box-shadow: 0 15px 30px rgba(251, 191, 36, 0.15), 0 0 0 1px var(--color-book) !important;
}
.glow-border-book:hover .icon-box {
    background: rgba(251, 191, 36, 0.2) !important;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.glow-border-article:hover {
    border-color: #10b981 !important;
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.15), 0 0 0 1px #10b981 !important;
}
.glow-border-article:hover .icon-box {
    background: rgba(16, 185, 129, 0.2) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}


/* Animations */
@keyframes modalFadeUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalFadeDown {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(40px) scale(0.95); }
}

.animate-fade-up {
    animation: modalFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-down {
    animation: modalFadeDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scrollbar */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.animate-shake {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--color-video);
  box-shadow: 0 0 10px var(--color-video);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Premium Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--siaio-neon); }
input:checked + .slider:before { transform: translateX(18px); }

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
}
.shake { animation: shake 0.4s ease-in-out; }

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

.mini-toolbar {
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-tool {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.mini-tool:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

/* AI Sparkle Button */
.ai-sparkle-btn {
    position: absolute;
    left: 15px; /* Left side for RTL */
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--siaio-neon);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5; /* Slightly more visible by default */
    pointer-events: auto; /* Make it clickable */
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}

.ai-sparkle-btn-relative {
    position: relative;
    background: transparent;
    border: none;
    color: var(--siaio-neon);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
    pointer-events: auto;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}

.ai-sparkle-btn.active,
.ai-sparkle-btn-relative.active {
    opacity: 1;
    pointer-events: auto;
    animation: sparkleGlow 2s infinite alternate;
}

.ai-sparkle-btn.active:hover,
.ai-sparkle-btn-relative.active:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 10px var(--color-podcast));
    color: var(--color-podcast);
}

@keyframes sparkleGlow {
    0% { filter: drop-shadow(0 0 2px var(--siaio-neon)); }
    100% { filter: drop-shadow(0 0 8px var(--siaio-neon)); color: #fff; }
}

/* AI Progress Indicator */
.ai-progress-container {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-progress-ring__svg {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
}
.ai-progress-circle-bg {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 2;
}
.ai-progress-circle {
    fill: transparent;
    stroke: url(#geminiGradient);
    stroke-width: 2;
    stroke-dasharray: 62.83;
    stroke-dashoffset: 62.83;
    transition: stroke-dashoffset 0.5s ease;
    stroke-linecap: round;
}
.ai-progress-text {
    font-size: 8px;
    font-weight: bold;
    color: var(--siaio-neon);
    z-index: 2;
    font-family: var(--font-primary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .glass-modal {
        width: 95% !important;
        margin: 10px auto !important;
        max-height: 90vh !important;
    }
    .modal-body {
        padding: 20px !important;
    }
    .premium-btn {
        height: 45px !important;
        font-size: 13px !important;
    }
    .publish-label {
        font-size: 13px !important;
    }
    .writing-stats-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }
    .book-toolbar {
        overflow-x: auto;
        padding-bottom: 10px;
        justify-content: flex-start !important;
    }
    .toolbar-group {
        flex-shrink: 0;
    }
}

.publish-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.publish-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.publish-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.publish-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Spacing & Layout */
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

/* Buttons */
.premium-btn {
    padding: 12px 24px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.premium-btn:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.premium-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.premium-btn.primary {
    background: linear-gradient(135deg, var(--color-video) 0%, #00bcff 100%) !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: 0 8px 25px rgba(0, 242, 255, 0.25) !important;
}

.premium-btn.primary:hover {
    box-shadow: 0 12px 30px rgba(0, 242, 255, 0.45) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.premium-btn.primary:active {
    transform: translateY(0) scale(0.98) !important;
}

/* Form Elements */
.publish-form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.publish-label {
    font-size: var(--font-size-label);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
    font-family: var(--font-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.publish-input, .publish-textarea, .publish-select {
    width: 100%;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px;
    color: #ffffff;
    font-family: var(--font-primary);
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.publish-input:focus, .publish-textarea:focus, .publish-select:focus {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: var(--color-video) !important;
    outline: none !important;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.publish-textarea {
    min-height: 140px;
    resize: vertical;
}

.publish-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.4)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 18px center !important;
    background-size: 18px !important;
    padding-left: 48px !important;
}

/* Stepper */
.stepper-container {
    display: flex;
    justify-content: space-between;
    padding: 30px 10px;
    position: relative;
    gap: 15px;
}

.stepper-container::before {
    content: '';
    position: absolute;
    top: 48px;
    left: 45px;
    right: 45px;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.stepper-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    position: relative;
}

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #0d0d11;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 800;
    margin-bottom: 12px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.stepper-item.active .step-circle {
    background: var(--color-video);
    border-color: var(--color-video);
    color: #000000;
    box-shadow: 0 0 25px rgba(0, 242, 255, 0.5);
    transform: scale(1.15);
}

.stepper-item.completed .step-circle {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.step-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.stepper-item.active .step-label {
    color: #ffffff;
}

/* Book Editor */
.book-editor {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 15px;
}

.book-editor-header {
    background: rgba(255,255,255,0.03);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.book-editor-header h3 {
    font-size: 16px;
    color: var(--color-book);
    margin: 0;
}

.book-editor-actions {
    display: flex;
    gap: 8px;
}

.book-page-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.book-page-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--color-book);
}

.book-page-editor-main {
    padding: 20px;
}

#bookPageEditor {
    min-height: 300px;
    color: rgba(255,255,255,0.9);
    line-height: 1.8;
    outline: none;
    font-size: 16px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
}

.book-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.toolbar-group {
    display: flex;
    gap: 5px;
    padding: 0 5px;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: 0.2s;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.font-size-select, .font-family-select {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    outline: none;
}

.book-page-editor-footer {
    padding: 10px 20px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: flex-end;
}

.book-page-info {
    display: flex;
    gap: 20px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

/* Loading Spinner for Buttons */
.btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--color-video);
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite, btn-color-cycle 2s linear infinite;
}

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

@keyframes btn-color-cycle {
    0%, 100% { border-top-color: #00f2ff; } /* Sky Blue */
    50% { border-top-color: #a855f7; } /* Deep Purple */
}

.premium-btn.loading .btn-spinner {
    display: inline-block;
}

.premium-btn.loading {
    pointer-events: none;
    opacity: 0.8;
    cursor: wait;
}

.premium-btn.loading i {
    display: none;
}

/* Floating Action Button (FAB) */
.fab-publish {
    position: fixed !important;
    bottom: 85px !important;
    right: 40px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: #0a0a0f !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 32px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    z-index: 2002 !important;
    box-shadow: 0 8px 20px rgba(0, 210, 255, 0.25) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    pointer-events: auto !important;
    user-select: none;
}

.fab-publish:hover {
    transform: scale(1.1) rotate(90deg) !important;
    box-shadow: 0 12px 25px rgba(0, 210, 255, 0.45) !important;
    color: #ffffff !important;
    background: #0a0a0f !important;
}

.fab-publish:active {
    transform: scale(0.95) !important;
}

/* Mobile Responsiveness Overrides for Modals & FAB */
@media (max-width: 768px) {
    /* Shrink FAB (+) Button */
    .fab-publish {
        bottom: 95px !important;
        right: 20px !important;
        width: 48px !important;
        height: 48px !important;
        font-size: 22px !important;
        background: #0a0a0f !important;
        color: #ffffff !important;
        box-shadow: 0 6px 15px rgba(0, 210, 255, 0.3) !important;
    }
    
    /* Responsive Dialog Panels */
    .modal {
        padding: 12px !important;
    }
    .glass-modal {
        border-radius: 24px !important;
        width: calc(100% - 10px) !important;
        margin: 8px auto !important;
        max-height: 94vh !important;
    }
    .modal-header {
        padding: 16px 20px !important;
    }
    .modal-header h3 {
        font-size: 16px !important;
    }
    .close-modal {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
    }
    .modal-body {
        padding: 20px !important;
    }
    
    /* Stepper Alignment */
    .stepper-container {
        padding: 12px 6px !important;
        gap: 8px !important;
    }
    .stepper-container::before {
        top: 26px !important;
        left: 20px !important;
        right: 20px !important;
    }
    .step-circle {
        width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }
    .step-label {
        font-size: 10px !important;
        letter-spacing: 0.5px !important;
    }
    
    /* Option Selector Grid */
    .publish-options-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .option-card {
        flex-direction: row !important;
        align-items: center !important;
        padding: 16px 20px !important;
        gap: 16px !important;
        border-radius: 16px !important;
        text-align: right !important;
    }
    .option-card .icon-box {
        width: 48px !important;
        height: 48px !important;
        border-radius: 12px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    .option-card .icon-box i {
        font-size: 18px !important;
    }
    .option-card div[style*="text-align: center"],
    .option-card div {
        text-align: right !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: center !important;
    }
    .option-card div div,
    .option-card div[style*="font-size: 19px"] {
        font-size: 15px !important;
        font-weight: 700 !important;
    }
    .option-card div div + div,
    .option-card div[style*="font-size: 12px"] {
        font-size: 11px !important;
        margin-top: 3px !important;
    }
    
    /* Drop Zone / File Selection */
    .upload-drop-zone {
        padding: 30px 16px !important;
        border-radius: 16px !important;
    }
    .upload-drop-zone .upload-icon {
        font-size: 32px !important;
        margin-bottom: 12px !important;
    }
    .upload-drop-zone div[style*="font-size: 16px"],
    #file-name-display {
        font-size: 14px !important;
    }
    .upload-drop-zone div[style*="font-size: 12px"] {
        font-size: 10px !important;
        margin-top: 4px !important;
    }
    
    /* Form Elements - Ensure no iOS Auto-Zoom */
    .publish-form-group {
        margin-bottom: 16px !important;
        gap: 6px !important;
    }
    .publish-label {
        font-size: 12px !important;
    }
    .publish-input, .publish-textarea, .publish-select {
        padding: 12px 16px !important;
        font-size: 16px !important; /* Critical to prevent iOS Safari auto-zoom */
        border-radius: 12px !important;
    }
    .publish-textarea {
        min-height: 100px !important;
    }
    .publish-select {
        background-position: left 14px center !important;
        background-size: 16px !important;
        padding-left: 38px !important;
    }
    
    /* Standardized Touch Buttons */
    .premium-btn {
        padding: 10px 20px !important;
        height: 48px !important; /* Touch friendly */
        font-size: 15px !important;
        border-radius: 12px !important;
    }
    .form-actions {
        margin-top: 24px !important;
        gap: 12px !important;
    }
    
    /* Success Dialog */
    #publishSuccessModal .glass-modal {
        padding: 24px 20px !important;
        max-width: 360px !important;
    }
    .success-icon-container {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 16px !important;
    }
    .success-icon-container i {
        font-size: 28px !important;
    }
    #publishSuccessModal h2 {
        font-size: 18px !important;
        margin-bottom: 8px !important;
    }
    #publishSuccessModal p {
        font-size: 13px !important;
        margin-bottom: 20px !important;
    }
    .publish-url-container {
        padding: 8px 12px !important;
        margin-bottom: 20px !important;
        gap: 8px !important;
        border-radius: 10px !important;
    }
    #final-publish-url {
        font-size: 12px !important;
    }
    .publish-url-container button {
        padding: 6px 12px !important;
        font-size: 11px !important;
    }
    #publishSuccessModal a i.fa-2x {
        font-size: 1.8em !important;
    }
    #publishSuccessModal button.premium-btn.primary {
        height: 46px !important;
        font-size: 14px !important;
    }

    /* Book Publisher Editor */
    .book-toolbar {
        padding: 10px !important;
        gap: 6px !important;
        border-radius: 16px 16px 0 0 !important;
    }
    .toolbar-group {
        gap: 4px !important;
        padding: 0 6px !important;
        border-left: 1px solid rgba(255,255,255,0.08) !important;
    }
    .toolbar-btn {
        width: 34px !important;
        height: 34px !important;
        border-radius: 8px !important;
        font-size: 13px !important;
    }
    #autosave-indicator {
        font-size: 10px !important;
    }
    #book-writing-area {
        min-height: 240px !important;
        max-height: 45vh !important;
        padding: 16px !important;
        font-size: 16px !important;
        line-height: 1.7 !important;
        border-radius: 0 0 16px 16px !important;
    }
    .writing-stats-bar {
        padding: 10px 16px !important;
        gap: 12px !important;
        font-size: 11px !important;
        border-radius: 0 0 16px 16px !important;
    }
    #bookPublishPanel .modal-body {
        padding: 16px !important;
    }
    #bookPublishPanel .stepper-container {
        max-width: 100% !important;
        margin-bottom: 16px !important;
    }
    #bookStickerModal .glass-modal {
        max-width: 340px !important;
        padding: 16px !important;
    }
    #bookStickerModal .modal-header {
        padding: 12px 16px !important;
    }
    #bookStickerModal h3 {
        font-size: 15px !important;
    }
    #bookStickerModal .modal-body {
        padding: 16px !important;
    }
    .modal-body.publish-scrollbar {
        max-height: 70vh !important;
    }
}

/* ==========================================================================
   Tingle.js Premium Glassmorphic Theme Overrides (Linear/Stripe Style)
   ========================================================================== */
.tingle-modal {
    background: rgba(2, 2, 5, 0.82) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    z-index: 200000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.tingle-modal-box {
    background: linear-gradient(145deg, rgba(18, 18, 24, 0.95), rgba(8, 8, 12, 0.98)) !important;
    backdrop-filter: blur(40px) !important;
    -webkit-backdrop-filter: blur(40px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 28px !important;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.8),
        0 0 120px rgba(0, 242, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    padding: 0 !important;
    width: 95% !important;
    max-width: 780px !important;
    overflow: hidden !important;
    position: relative !important;
    transform: scale(0.96) translateY(20px) !important;
    animation: tingle-spring 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes tingle-spring {
    to {
        transform: scale(1) translateY(0) !important;
        opacity: 1;
    }
}

/* Beautiful Glowing Accent Line at the Top */
.tingle-modal-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-video), var(--color-podcast), var(--color-book), var(--color-success));
    z-index: 100;
}

.tingle-modal-box__content {
    padding: 0 !important; /* Let modal body content handle it */
    max-height: 82vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Strip away inner modal-panel styling when hosted inside Tingle */
.tingle-modal-box .modal-panel {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
}

/* Adjust Inner Padding of Modal Bodies inside Tingle */
.tingle-modal-box .modal-body {
    padding: 24px 28px !important;
}

/* Premium compact sizes for form components to prevent clunkiness */
.tingle-modal-box .publish-form-group {
    margin-bottom: 18px !important;
    gap: 8px !important;
}

.tingle-modal-box .publish-label {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.5) !important;
    margin-bottom: 2px !important;
}

.tingle-modal-box .publish-input, 
.tingle-modal-box .publish-textarea, 
.tingle-modal-box .publish-select {
    padding: 12px 16px !important;
    font-size: 15px !important; /* Extremely readable yet compact */
    border-radius: 12px !important;
}

.tingle-modal-box .publish-textarea {
    min-height: 110px !important;
}

/* Upload drop zone sizing adjustments */
.tingle-modal-box .upload-drop-zone {
    padding: 35px 20px !important;
    border-radius: 16px !important;
}

.tingle-modal-box .upload-drop-zone .upload-icon {
    font-size: 38px !important;
    margin-bottom: 12px !important;
}

.tingle-modal-box .upload-drop-zone div[style*="font-size: 16px"],
.tingle-modal-box #file-name-display {
    font-size: 14px !important;
}

/* Stepper tweaks for clean alignment */
.tingle-modal-box .stepper-container {
    padding: 10px 0 25px 0 !important;
    margin-bottom: 5px !important;
}

.tingle-modal-box .stepper-container::before {
    top: 28px !important;
    height: 2px !important;
}

.tingle-modal-box .step-circle {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
    margin-bottom: 8px !important;
}

.tingle-modal-box .step-label {
    font-size: 10px !important;
}


/* Hide Tingle's default close button as we use the header's close button */
.tingle-modal__close {
    display: none !important;
}

/* Adjust standard modal header: smaller padding and reverse flex direction for RTL left-close layout */
.modal-header {
    padding: 14px 20px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-direction: row-reverse !important; /* Title to the right, close button to the left */
    position: relative !important;
    width: 100% !important;
}

.modal-header h3 {
    margin: 0 !important;
    font-size: 17px !important; /* Smaller, neat title size */
    font-weight: 800 !important;
    background: linear-gradient(135deg, #ffffff 0%, #b5b5c3 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Redesign native modal header close button to look premium and sit on the left */
.modal-header .close-modal {
    background: rgba(255, 255, 255, 0.04) !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    margin: 0 !important;
}

.modal-header .close-modal:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    transform: rotate(90deg) scale(1.05) !important;
}

.modal-header .close-modal:hover i {
    color: #ef4444 !important;
}

.modal-header .close-modal i {
    transition: color 0.3s !important;
    font-size: 15px !important;
}


/* Mobile overrides for Tingle */
@media (max-width: 768px) {
    .tingle-modal-box {
        border-radius: 24px !important;
        width: calc(100% - 10px) !important;
        margin: 8px auto !important;
        max-height: 94vh !important;
    }
}

/* Hide original native overlays since Tingle hosts the panels now */
#publishTypeModal, #publishFormModal, #bookPublishModal, #bookStickerModal, #publishSuccessModal {
    background: transparent !important;
    pointer-events: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}



