/* InterActive Viewer Plugin Styles - Premium Edition */

/* ----------------------------------
   Core Container
---------------------------------- */
#ia-viewer-container {
    width: 100%;
    height: 85vh;
    min-height: 600px;
    background: #f8fafc;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Tajawal', 'Inter', system-ui, sans-serif;
    position: relative;
    box-sizing: border-box;
    transition: background 0.4s ease, box-shadow 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Move Sidebar to the Right in RTL */
#ia-viewer-screen {
    flex-direction: row-reverse !important;
}

/* Dark Mode Container */
#ia-viewer-container.ia-viewer-dark-mode {
    background: #0B1121;
    color: #f8fafc;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Mesh Gradient Background Effect */
#ia-viewer-container.ia-viewer-dark-mode::before,
#ia-viewer-container.ia-viewer-dark-mode::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
    animation: iaBgFloat 20s infinite alternate ease-in-out;
}

#ia-viewer-container.ia-viewer-dark-mode::before {
    background: #4f46e5;
    top: -20vw;
    left: -20vw;
}

#ia-viewer-container.ia-viewer-dark-mode::after {
    background: #ec4899;
    bottom: -20vw;
    right: -20vw;
    animation-delay: -10s;
}

@keyframes iaBgFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5vw, 5vw) scale(1.1); }
}

/* Global SVG Reset for WordPress Conflicts */
#ia-viewer-container svg {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
}
#ia-viewer-container .ia-azkar-icon-bg svg {
    fill: #f59e0b !important;
    stroke: white !important;
}

/* Wide Mode overrides */
body.ia-has-wide-mode {
    overflow: hidden !important;
}
#ia-viewer-container.ia-viewer-wide-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 999999 !important;
}

/* ----------------------------------
   Glassmorphism Effects
---------------------------------- */
.ia-glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.ia-viewer-dark-mode .ia-glass-panel {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ----------------------------------
   Header
---------------------------------- */
.ia-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    z-index: 20;
    transition: all 0.3s ease;
}

.ia-welcome-msg {
    font-size: 1.15rem;
    font-weight: 500;
    color: #475569;
    letter-spacing: 0.3px;
}

.ia-viewer-dark-mode .ia-welcome-msg {
    color: #cbd5e1;
}

.ia-user-name {
    color: #2563eb;
    font-weight: 800;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ia-controls {
    display: flex;
    gap: 12px;
}

/* ----------------------------------
   Buttons & Micro-animations
---------------------------------- */
.ia-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.ia-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.ia-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.ia-btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.ia-viewer-dark-mode .ia-btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ia-btn-secondary:hover {
    background: #e2e8f0;
}

.ia-viewer-dark-mode .ia-btn-secondary:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Hover Glow Effect */
.ia-hover-glow:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Pulse Animation */
@keyframes iaPulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.ia-pulse-hover:hover {
    animation: iaPulse 1.5s infinite;
}

/* ----------------------------------
   Workspace & Empty State
---------------------------------- */
.ia-viewer-workspace {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    overflow: hidden;
    transition: background 0.4s ease;
}

.ia-viewer-dark-mode .ia-viewer-workspace {
    background: #020617; /* Deep dark */
}


#ia-video-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: black;
}

/* Empty State Modern */
.ia-empty-state-modern {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    animation: iaFadeIn 0.8s ease-out;
}

.ia-viewer-dark-mode .ia-empty-state-modern {
    color: #94a3b8;
}

.ia-icon-placeholder {
    margin-bottom: 20px;
    color: #94a3b8;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ia-viewer-dark-mode .ia-icon-placeholder {
    color: #334155;
}

/* Glow behind folder */
.ia-icon-placeholder::after {
    content: '';
    position: absolute;
    width: 60px; height: 60px;
    background: #3b82f6;
    filter: blur(40px);
    opacity: 0.2;
    border-radius: 50%;
    z-index: -1;
}

.ia-viewer-dark-mode .ia-icon-placeholder::after {
    background: #4f46e5;
    opacity: 0.15;
}

.ia-empty-state-modern h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #334155;
}

.ia-viewer-dark-mode .ia-empty-state-modern h3 {
    color: #f1f5f9;
}

.ia-empty-state-modern p {
    font-size: 1rem;
    line-height: 1.6;
    color: #64748b;
}

.ia-viewer-dark-mode .ia-empty-state-modern p {
    color: #94a3b8;
}

@keyframes iaFadeIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ----------------------------------
   Whiteboard & Watermarks
---------------------------------- */
#ia-whiteboard-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100;
    pointer-events: auto;
    cursor: crosshair;
}

.ia-watermark-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 9999;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    grid-auto-rows: 250px;
    align-items: center;
    justify-items: center;
    overflow: hidden;
}

.ia-watermark-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    user-select: none;
    color: rgba(255,255,255,0.1);
}

/* ----------------------------------
   Footer
---------------------------------- */
.ia-viewer-footer {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 12px 30px;
    z-index: 20;
    gap: 15px;
    background: #1e293b  ;
    color: white;
    flex-wrap: wrap;
    border-top: 2px solid #3b82f6;
    flex-shrink: 0;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    font-size: 0.95rem;
}

.ia-footer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: inherit;
    font-weight: 500;
    color: inherit !important;
}

/* Force all child elements in the footer to inherit the parent's text color */
.ia-footer-item,
.ia-footer-item span,
.ia-footer-item div,
.ia-footer-item a {
    color: inherit !important;
}

/* Make SVG icons scale and inherit text color dynamically */
.ia-footer-item .ia-icon-svg,
.ia-footer-item svg {
    color: inherit !important;
    width: 1.2em;
    height: 1.2em;
    display: inline-block;
}

/* Dynamically adjust SVG strokes to match text color */
.ia-footer-item svg *,
.ia-footer-item svg path,
.ia-footer-item svg circle,
.ia-footer-item svg rect,
.ia-footer-item svg line,
.ia-footer-item svg polyline,
.ia-footer-item svg polygon {
    stroke: currentColor !important;
}

/* Handle fill-only SVGs */
.ia-footer-item svg [fill]:not([fill="none"]),
.ia-footer-item svg path:not([fill="none"]) {
    fill: currentColor !important;
}

/* Add dividers between footer items that adapt dynamically to text color */
.ia-divider-item {
    position: relative;
}

.ia-divider-item::before, .ia-divider-item::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 18px;
    background: currentColor !important;
    opacity: 0.3 !important;
}

.ia-divider-item::before { left: -15px; }
.ia-divider-item::after { right: -15px; }

/* ----------------------------------
   Password Modal
---------------------------------- */
.ia-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: iaModalFadeIn 0.3s forwards;
}

@keyframes iaModalFadeIn {
    to { opacity: 1; }
}

.ia-modal-box {
    background: #1e293b;
    padding: 40px;
    border-radius: 16px;
    width: 420px;
    max-width: 95%;
    max-height: 95vh;
    box-sizing: border-box;
    text-align: center;
    color: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    animation: iaModalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes iaModalSlideUp {
    to { transform: translateY(0); }
}

.ia-modal-box h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
}

.ia-modal-input {
    width: 100%;
    padding: 14px 16px;
    margin: 15px 0 25px 0;
    border-radius: 10px;
    border: 1px solid #475569;
    background: #0f172a;
    color: white;
    text-align: center;
    font-size: 1.1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.ia-modal-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.ia-modal-error {
    color: #ef4444;
    font-size: 0.95rem;
    margin-bottom: 15px;
    display: none;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ----------------------------------
   Welcome Screen (Dual Screen)
---------------------------------- */
.ia-welcome-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a !important; /* Solid Premium Dark Slate */
    z-index: 10;
}

.ia-welcome-modal {
    background: #1e293b !important; /* Solid Medium Slate Card */
    padding: 50px 40px !important;
    border-radius: 16px !important;
    text-align: center;
    width: 480px;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid #334155 !important; /* Solid border */
}

.ia-shield-icon {
    width: 80px; height: 80px;
    background: #0f172a !important; /* Solid background */
    border: 2px solid #3b82f6 !important; /* Solid brand blue */
    border-radius: 50% !important; /* Premium circular badge */
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px auto;
    position: relative;
    box-shadow: none !important;
}

.ia-shield-icon svg {
    stroke: #3b82f6 !important;
    filter: none !important; /* Remove glow for solid/clean style */
    width: 38px; height: 38px;
}

.ia-welcome-modal h2 {
    color: #ffffff !important;
    font-size: 1.8rem;
    margin-bottom: 12px;
    font-weight: 700;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.ia-welcome-user {
    color: #94a3b8 !important;
    font-size: 1.05rem;
    margin-bottom: 25px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.ia-user-name-highlight {
    color: #3b82f6 !important;
    font-weight: bold;
}

.ia-welcome-actions {
    display: flex; gap: 15px; justify-content: center;
}

.ia-welcome-actions .ia-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
    font-weight: bold !important;
    border-radius: 8px !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
}

/* Primary welcome action */
.ia-welcome-actions .ia-btn-primary {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border: none !important;
}
.ia-welcome-actions .ia-btn-primary:hover {
    background: #2563eb !important;
}
.ia-welcome-actions .ia-btn-primary:active {
    transform: scale(0.98);
}

/* Secondary welcome action */
.ia-welcome-actions .ia-btn-secondary {
    background: #334155 !important;
    color: #cbd5e1 !important;
    border: none !important;
}
.ia-welcome-actions .ia-btn-secondary:hover {
    background: #475569 !important;
    color: #ffffff !important;
}
.ia-welcome-actions .ia-btn-secondary:active {
    transform: scale(0.98);
}

/* ----------------------------------
   Tabs Bar
---------------------------------- */
.ia-tabs-bar {
    display: flex;
    overflow-x: auto;
    background: var(--ia-tools-bg, #1e293b);
    padding: 10px 10px 0 10px !important;
    gap: 6px;
    border-bottom: 2px solid #3b82f6 !important;
    min-height: 48px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* ----------------------------------
   Sidebar & Layout
---------------------------------- */
.ia-sidebar {
    width: 280px;
    min-width: 250px;
    max-width: 600px;
    background: var(--ia-tools-bg, #1e293b);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 5;
    position: relative;
}

.ia-sidebar-resizer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    width: 6px;
    cursor: col-resize;
    z-index: 99;
    background: transparent;
    transition: background 0.2s;
}
.ia-sidebar-resizer:hover,
.ia-sidebar-resizer.dragging {
    background: #3b82f6;
}

.ia-sidebar-header {
    padding: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--ia-tools-color, white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.ia-sidebar-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.ia-sidebar-tool {
    margin-bottom: 25px;
    background: rgba(15, 23, 42, 0.5);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.ia-tool-title {
    color: var(--ia-tools-color, #cbd5e1);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ia-sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--ia-tools-color, inherit);
}

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

.ia-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ia-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #475569;
    transition: .4s;
    border-radius: 24px;
}

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

input:checked + .ia-slider {
    background-color: #10b981;
}

input:checked + .ia-slider:before {
    transform: translateX(20px);
}

/* Icon Buttons */
.ia-btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
}
.ia-btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ia-btn-success {
    background: #10b981;
    color: white;
}
.ia-btn-success:hover {
    background: #059669;
}

/* ----------------------------------
   Tabs Area
---------------------------------- */

.ia-tabs-bar {
    height: 50px;
    background: var(--ia-tools-bg, #0f172a);
    display: flex;
    align-items: flex-end;
    padding: 0 10px;
    gap: 0;
    border-bottom: 2px solid #3b82f6; /* Blue line matching Desktop App */
    overflow-x: auto;
}

.ia-tabs-bar::-webkit-scrollbar { height: 4px; }
.ia-tabs-bar::-webkit-scrollbar-thumb { background: #334155; }

.ia-tab {
    padding: 10px 18px;
    background: #334155;
    color: #cbd5e1 !important;
    border-radius: 8px 8px 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.3s ease;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    margin-right: 4px;
}

.ia-tab:hover {
    background: #475569;
    color: #ffffff !important;
}

.ia-tab.active {
    background: #ffffff;
    color: #0f172a !important;
    border-color: #ffffff;
    border-top: none;
    box-shadow: none;
    font-weight: 700;
}

.ia-tab-close {
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.7;
    transition: color 0.2s;
}
.ia-tab-close:hover { opacity: 1; color: #ef4444 !important; background: transparent !important; }

/* Desktop App Style Azkar Card */
.ia-sidebar-tool.ia-azkar-card-style {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    cursor: pointer;
    transition: all 0.3s;
    flex-direction: row-reverse; /* Bell+text on right, gear on left */
}
.ia-sidebar-tool.ia-azkar-card-style:hover {
    background: rgba(45, 55, 72, 0.8) !important;
}
.ia-sidebar-tool.ia-azkar-card-style .ia-tool-title {
    color: #67e8f9 !important; /* Cyan like desktop */
    font-weight: bold;
    font-size: 0.95rem;
}
.ia-azkar-gear-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.ia-azkar-gear-btn:hover {
    background: transparent !important;
}
.ia-azkar-gear-btn svg {
    stroke: #94a3b8 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Floating Controls */
.ia-floating-controls {
    position: absolute;
    top: 65px; left: 20px;
    display: flex; gap: 10px;
    z-index: 50;
}

/* ----------------------------------
   Azkar Toast & Timer Overlay
---------------------------------- */
.ia-azkar-toast {
    position: absolute;
    bottom: 80px; left: 50%;
    transform: translateX(-50%);
    background: rgba(234, 179, 8, 0.9);
    color: #451a03;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 10px 25px rgba(234, 179, 8, 0.3);
    z-index: 9999;
    animation: iaToastSlideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes iaToastSlideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.ia-timer-overlay {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 8px 20px;
    display: flex;
    flex-direction: row-reverse; /* RTL Support */
    align-items: center;
    gap: 15px;
    z-index: 50;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#ia-timer-display {
    font-size: 1.4rem;
    font-family: 'Inter', monospace;
    font-weight: 800;
    color: #f43f5e;
    text-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
    letter-spacing: 1px;
}

.ia-timer-controls {
    display: flex;
    gap: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 15px;
    margin-left: 5px;
}

.ia-timer-controls .ia-btn-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.ia-timer-controls .ia-btn-icon:hover {
    background: rgba(255,255,255,0.15);
}

/* ----------------------------------
   Azkar Modal Styles (Complex)
---------------------------------- */
.ia-azkar-modal-box {
    background: #0f172a;
    width: 450px;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    color: #cbd5e1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    animation: iaModalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.ia-azkar-header {
    background: #1e293b;
    padding: 25px 20px 20px 20px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ia-azkar-close {
    position: absolute;
    top: 15px; left: 15px;
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}
.ia-azkar-close:hover { color: white !important; background: transparent !important; }

.ia-azkar-title-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ia-azkar-title h3 {
    color: white;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 5px 0;
}
.ia-azkar-title p {
    color: #94a3b8;
    margin: 0;
    font-size: 0.9rem;
}

.ia-azkar-icon-bg {
    background: #10b981; /* Green bg from screenshot */
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ia-azkar-icon-bg svg {
    stroke: white;
    fill: #f59e0b; /* Yellowish bell */
}

.ia-azkar-toggle-area {
    background: #1e293b;
    margin: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ia-azkar-toggle-text h4 {
    color: white;
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ia-azkar-toggle-text p {
    color: #64748b;
    margin: 0;
    font-size: 0.85rem;
}

.ia-azkar-cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    padding: 0 20px;
}

.ia-azkar-card {
    background: #1e293b;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}
.ia-azkar-card-title {
    color: #3b82f6; /* Default to blue, overridden inline */
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.ia-azkar-card-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.ia-azkar-card-input input {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 60px;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
}
.ia-azkar-card-input span {
    font-size: 0.8rem;
    color: #64748b;
}
.ia-azkar-select {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px;
    border-radius: 8px;
    width: 100%;
    text-align: center;
    font-family: inherit;
    cursor: pointer;
}

.ia-azkar-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 20px 10px 20px;
}
.ia-azkar-list-title {
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ia-badge {
    background: #059669;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
}
.ia-btn-outline-green {
    background: transparent;
    border: 1px solid #10b981;
    color: #10b981;
    padding: 5px 12px;
    font-size: 0.85rem;
}
.ia-btn-outline-green:hover {
    background: #10b981;
    color: white;
}

.ia-azkar-list-container {
    padding: 0 20px;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ia-azkar-list-container::-webkit-scrollbar { width: 6px; }
.ia-azkar-list-container::-webkit-scrollbar-track { background: #0f172a; }
.ia-azkar-list-container::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }

.ia-dhikr-item {
    background: #1e293b;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.ia-dhikr-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    text-align: right;
    outline: none;
}
.ia-dhikr-num {
    background: #059669;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 10px;
}
.ia-dhikr-del {
    color: #ef4444;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 10px;
    opacity: 0.7;
}
.ia-dhikr-del:hover { opacity: 1; }

.ia-azkar-footer-info {
    text-align: center;
    padding: 15px;
    color: #f59e0b;
    font-size: 0.85rem;
}

.ia-azkar-actions {
    background: #1e293b;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.ia-btn-text {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-family: inherit;
}
.ia-btn-text:hover { color: white; }

/* Sidebar Tool Wrapper & Sub-toolbars */
.ia-sidebar-tool-wrapper {
    margin-bottom: 20px;
}
.ia-sidebar-tool-wrapper .ia-sidebar-tool {
    margin-bottom: 10px;
}
.ia-sub-toolbar {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    margin-top: -5px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

/* Whiteboard toolbar elements */
.ia-tool-row {
    display: flex;
    width: 100%;
    gap: 8px;
}
.ia-tool-btn {
    flex: 1;
    background: #2a3241 !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 8px;
    color: white !important;
    font-size: 18px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.ia-tool-btn:hover {
    background: #374151 !important;
}
.ia-tool-btn.active {
    background: #3b82f6 !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Color input customization */
.ia-color-picker-wrapper {
    width: 42px;
    height: 38px;
    border-radius: 6px;
    border: 2px solid white;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.ia-color-picker-wrapper input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    cursor: pointer;
    background: none;
}

/* Slider styling */
.ia-range-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #475569;
    outline: none;
    cursor: pointer;
}
.ia-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #00bcd4;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.ia-btn-clear {
    width: 100%;
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.ia-btn-clear:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    color: white !important;
}

/* Digital Timer */
.ia-timer-digital {
    font-size: 38px;
    font-weight: bold;
    color: #ef4444; /* Bright red matching desktop */
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
}
.ia-timer-btn-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}
.ia-timer-btn {
    background: #2a3241 !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 6px;
    color: #cbd5e1 !important;
    padding: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.ia-timer-btn:hover {
    background: #374151 !important;
    color: white !important;
}
.ia-timer-btn.start-btn {
    background: #3b82f6 !important;
    border-color: #60a5fa !important;
    color: white !important;
    font-weight: bold;
    flex: 2;
}
.ia-timer-btn.start-btn:hover {
    background: #2563eb !important;
}
.ia-timer-btn.small-btn {
    font-size: 15px;
    flex: 0.8;
}

/* Timer box matching desktop */
.ia-timer-box {
    padding: 15px !important;
    border: 2px solid #3b82f6 !important;
    border-radius: 10px !important;
    background: #1e293b !important;
    text-align: center;
}

/* ============================================
   Timer Input Modal (Professional)
============================================ */
.ia-timer-modal-box {
    text-align: center;
    max-width: 380px;
}
.ia-timer-modal-box h3 {
    color: #f1f5f9;
    font-size: 1.2rem;
    margin: 0 0 4px;
}
.ia-timer-modal-box p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0 0 18px;
}
.ia-timer-modal-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}
.ia-timer-modal-input-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}
#ia-timer-modal-input,
#ia-timer-modal-input-sec {
    width: 90px;
    padding: 12px 10px;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    background: #0f172a;
    color: #3b82f6;
    border: 2px solid #334155;
    border-radius: 12px;
    outline: none;
    font-family: 'Courier New', monospace;
    transition: border-color 0.3s;
}
#ia-timer-modal-input:focus,
#ia-timer-modal-input-sec:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}
#ia-timer-modal-input::placeholder,
#ia-timer-modal-input-sec::placeholder {
    color: #475569;
}
.ia-timer-modal-unit {
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 600;
}
.ia-timer-modal-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.ia-timer-preset-btn {
    padding: 8px 0;
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.ia-timer-preset-btn:hover {
    background: #3b82f6;
    color: white;
    border-color: #60a5fa;
    transform: translateY(-1px);
}
.ia-modal-actions {
    display: flex;
    gap: 10px;
}
.ia-modal-actions .ia-btn {
    flex: 1;
    padding: 10px;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 10px;
}
.ia-btn-primary {
    background: #3b82f6 !important;
    color: white !important;
    border: none !important;
}
.ia-btn-primary:hover {
    background: #2563eb !important;
}

/* ============================================
   Sidebar Account Section
============================================ */
.ia-sidebar-account {
    margin-top: 15px;
    background: rgba(30, 41, 59, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 10px;
    padding: 10px 12px;
    transition: all 0.3s ease;
}
.ia-sidebar-account:hover {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}
.ia-account-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    width: 100%;
}
.ia-account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    border: 2px solid #3b82f6;
    object-fit: cover;
    flex-shrink: 0;
}
.ia-account-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    text-align: right;
}
.ia-account-title {
    color: #f1f5f9;
    font-size: 0.88rem;
    font-weight: 700;
}
.ia-account-email {
    color: #94a3b8;
    font-size: 0.75rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 180px;
    display: block;
}

/* ============================================
   Modal Symmetrical Resizing CSS
============================================ */
.ia-azkar-modal-box {
    position: relative; /* Crucial for absolute positioned handles */
}

/* Resized state handles */
.ia-azkar-modal-box.ia-resized {
    /* Height and width are set inline by JS, override list overflow constraints */
}
.ia-azkar-modal-box.ia-resized .ia-azkar-list-container {
    max-height: none !important;
    flex: 1 !important;
}

/* Handles styling */
.ia-resize-handle {
    position: absolute;
    background: transparent;
    z-index: 9999;
    transition: background 0.2s;
}
.ia-resize-handle:hover,
.ia-resize-handle:active {
    background: rgba(99, 179, 237, 0.18);
}

/* ============================================
   Azkar Modal – Expand Button & Expanded State
============================================ */
.ia-azkar-header-btns {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.ia-azkar-expand-btn {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}
.ia-azkar-expand-btn:hover {
    color: #38bdf8 !important;
    background: transparent !important;
}

/* Wide / expanded state */
.ia-azkar-modal-box.ia-expanded {
    width: 750px !important;
    max-width: 95vw !important;
}
.ia-azkar-modal-box.ia-expanded .ia-azkar-cards-container {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    padding: 0 30px;
}
.ia-azkar-modal-box.ia-expanded .ia-azkar-list-container {
    max-height: 320px;
}


/* Edges */
.ia-resize-handle.top {
    top: -4px; left: 6px; right: 6px;
    height: 8px;
    cursor: n-resize;
}
.ia-resize-handle.bottom {
    bottom: -4px; left: 6px; right: 6px;
    height: 8px;
    cursor: s-resize;
}
.ia-resize-handle.left {
    left: -4px; top: 6px; bottom: 6px;
    width: 8px;
    cursor: w-resize;
}
.ia-resize-handle.right {
    right: -4px; top: 6px; bottom: 6px;
    width: 8px;
    cursor: e-resize;
}

/* Corners */
.ia-resize-handle.top-left {
    top: -4px; left: -4px;
    width: 10px; height: 10px;
    cursor: nw-resize;
}
.ia-resize-handle.top-right {
    top: -4px; right: -4px;
    width: 10px; height: 10px;
    cursor: ne-resize;
}
.ia-resize-handle.bottom-left {
    bottom: -4px; left: -4px;
    width: 10px; height: 10px;
    cursor: sw-resize;
}
.ia-resize-handle.bottom-right {
    bottom: -4px; right: -4px;
    width: 10px; height: 10px;
    cursor: se-resize;
}

.ia-footer-emoji {
    font-size: 1.2em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Teacher Settings Modal styling */
.ia-teacher-settings-box {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
    overflow: hidden;
    max-width: 95% !important;
    max-height: 95vh !important;
    box-sizing: border-box !important;
}

.ia-modal-input-style, .ia-modal-select-style {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-family: 'Cairo', 'Tajawal', sans-serif !important;
    outline: none !important;
    transition: border-color 0.2s ease !important;
}

.ia-modal-input-style:focus, .ia-modal-select-style:focus {
    border-color: #3b82f6 !important;
}

.ia-settings-tab-btn {
    font-family: 'Cairo', 'Tajawal', sans-serif !important;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.ia-settings-tab-btn:hover {
    color: #3b82f6 !important;
}

.ia-settings-tab-btn.active {
    border-bottom: 2px solid #3b82f6 !important;
}

.ia-modal-sortable .ia-modal-sort-item {
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.ia-modal-sortable .ia-modal-sort-item:hover {
    background: #1e293b !important;
    border-color: #3b82f6 !important;
}

.ia-modal-sortable .ia-modal-sort-item:active {
    cursor: grabbing !important;
    transform: scale(0.98);
}

/* Placeholder styling for sortable */
.ia-sortable-placeholder {
    border: 2px dashed #3b82f6 !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border-radius: 8px !important;
    flex: 1 !important;
    min-height: 40px !important;
}

/* Sort button styling */
.ia-sort-btn {
    transition: all 0.2s ease !important;
    user-select: none !important;
}

.ia-sort-btn:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

.ia-sort-btn:active {
    transform: scale(0.9) !important;
}

