/* ========================================
   UNIFIED EFFECTS PANEL
   Header toggle + dropdown panel
======================================== */

/* ========================================
   HEADER TOGGLE BUTTON
======================================== */
.effects-header-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.theme-dark .effects-header-toggle {
    background: rgba(0, 255, 65, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 255, 65, 0.2);
}

.theme-dark .effects-header-toggle:hover,
.theme-dark .effects-header-toggle.active {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.theme-dark .effects-header-toggle.disabled {
    opacity: 0.5;
}

.theme-light .effects-header-toggle {
    background: rgba(139, 90, 43, 0.1);
    color: #8b5a2b;
    border: 1px solid rgba(139, 90, 43, 0.2);
}

.theme-light .effects-header-toggle:hover,
.theme-light .effects-header-toggle.active {
    background: rgba(139, 90, 43, 0.15);
}

.theme-light .effects-header-toggle.disabled {
    opacity: 0.5;
}

.effects-toggle-label {
    font-weight: 500;
}

/* ========================================
   DROPDOWN PANEL
======================================== */
.effects-dropdown-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 280px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 10000;
    overflow: hidden;
}

.effects-dropdown-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-dark .effects-dropdown-panel {
    background: rgba(15, 15, 20, 0.98);
    border: 1px solid rgba(0, 255, 65, 0.2);
}

.theme-light .effects-dropdown-panel {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(139, 90, 43, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Panel Header */
.effects-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, rgba(128,128,128,0.2));
    font-weight: 600;
    font-size: 0.9rem;
}

.theme-dark .effects-panel-header {
    color: var(--accent);
    border-bottom-color: rgba(0, 255, 65, 0.15);
}

.theme-light .effects-panel-header {
    color: #8b5a2b;
    border-bottom-color: rgba(139, 90, 43, 0.15);
}

.effects-panel-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.effects-panel-close:hover {
    opacity: 1;
}

/* Panel Body */
.effects-panel-body {
    padding: 14px 16px;
}

/* Effect Row */
.effect-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.effect-row.master-row {
    padding-bottom: 14px;
}

.effect-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.effect-divider {
    height: 1px;
    background: var(--border-color, rgba(128,128,128,0.2));
    margin: 4px 0 14px;
}

.theme-dark .effect-divider {
    background: rgba(0, 255, 65, 0.1);
}

.theme-light .effect-divider {
    background: rgba(139, 90, 43, 0.1);
}

/* Effect Section */
.effect-section {
    margin-bottom: 16px;
}

.effect-section:last-child {
    margin-bottom: 0;
}

.effect-section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* Effect Options Grid */
.effect-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.effect-option {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: rgba(128, 128, 128, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.effect-option:hover {
    background: rgba(128, 128, 128, 0.2);
}

.theme-dark .effect-option.active {
    border-color: var(--accent);
    background: rgba(0, 255, 65, 0.15);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.theme-light .effect-option.active {
    border-color: #8b5a2b;
    background: rgba(139, 90, 43, 0.15);
}

/* Option Previews */
.option-preview {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-block;
}

/* Cursor Text Labels */
.cursor-text {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    line-height: 1;
    text-align: center;
}

/* Text Effect Previews */
.text-preview-none {
    opacity: 0.4;
    font-size: 0.65rem;
}

.text-preview-binary {
    font-family: 'Fira Code', monospace;
    color: var(--accent);
}

.theme-light .text-preview-binary {
    color: #8b5a2b;
}

.text-preview-scramble {
    font-family: 'Fira Code', monospace;
    color: #00ffff;
}

.theme-light .text-preview-scramble {
    color: #d2691e;
}

/* Background Previews */
.bg-preview-default,
.bg-preview-grid,
.bg-preview-matrix,
.bg-preview-binary,
.bg-preview-scanlines {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid rgba(128, 128, 128, 0.3);
    display: block;
}

.theme-dark .bg-preview-default {
    background: #0a0a0a;
}

.theme-light .bg-preview-default {
    background: #faf8f5;
}

.bg-preview-grid {
    background: 
        linear-gradient(rgba(0, 255, 65, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.4) 1px, transparent 1px),
        #0a0a0a;
    background-size: 6px 6px;
}

.theme-light .bg-preview-grid {
    background: 
        linear-gradient(rgba(139, 90, 43, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 90, 43, 0.3) 1px, transparent 1px),
        #faf8f5;
    background-size: 6px 6px;
}

/* Matrix preview - falling code look */
.bg-preview-matrix {
    background: #0a0a0a;
    font-size: 0.5rem;
    font-family: monospace;
    color: #00ff41;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 4px #00ff41;
}

.theme-light .bg-preview-matrix {
    background: #faf8f5;
    color: #8b5a2b;
    text-shadow: none;
}

/* Binary preview */
.bg-preview-binary {
    background: #0a0a0a;
    font-size: 0.5rem;
    font-family: monospace;
    color: #00ff41;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-light .bg-preview-binary {
    background: #faf8f5;
    color: #8b5a2b;
}

.bg-preview-scanlines {
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.2) 2px,
        rgba(0, 255, 65, 0.2) 4px
    ),
    #0a0a0a;
}

.theme-light .bg-preview-scanlines {
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(139, 90, 43, 0.15) 2px,
        rgba(139, 90, 43, 0.15) 4px
    ),
    #faf8f5;
}

/* Toggle Switch */
.toggle-switch-small {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

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

.toggle-slider-small {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(100, 100, 100, 0.4);
    border-radius: 22px;
    transition: all 0.2s;
    border: 1px solid rgba(150, 150, 150, 0.3);
}

.theme-light .toggle-slider-small {
    background: rgba(150, 150, 150, 0.3);
    border-color: rgba(100, 100, 100, 0.2);
}

.toggle-slider-small::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #888;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* When ON - dark green/brown and darker look */
.toggle-switch-small input:checked + .toggle-slider-small {
    background: rgba(0, 100, 30, 0.8);
    border-color: rgba(0, 255, 65, 0.4);
}

.toggle-switch-small input:checked + .toggle-slider-small::before {
    background: #00ff41;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
    transform: translateX(18px);
}

.theme-light .toggle-switch-small input:checked + .toggle-slider-small {
    background: rgba(100, 60, 20, 0.7);
    border-color: rgba(139, 90, 43, 0.4);
}

.theme-light .toggle-switch-small input:checked + .toggle-slider-small::before {
    background: #8b5a2b;
    transform: translateX(18px);
}

/* Select Dropdown */
.effect-select {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    min-width: 120px;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.theme-dark .effect-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 65, 0.2);
    color: var(--text-primary);
}

.theme-dark .effect-select:focus {
    outline: none;
    border-color: var(--accent);
}

.theme-dark .effect-select option {
    background: #1a1a1f;
    color: #fff;
}

.theme-light .effect-select {
    background-color: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(139, 90, 43, 0.2);
    color: var(--text-primary);
}

.theme-light .effect-select:focus {
    outline: none;
    border-color: #8b5a2b;
}

.theme-light .effect-select option {
    background: #fff;
    color: #333;
}

/* ========================================
   CURSOR STYLES (CSS-only)
   Using simple inline SVG data URIs
   NOTE: Uses style-cursor-* prefix to avoid conflict with cursor.js
   Includes contextual cursors: default, text, pointer, not-allowed
======================================== */

/* === POINTER CURSOR === */
/* Dark theme - default state */
html.theme-dark body.style-cursor-pointer {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 4 L4 18 L8 14 L12 20 L14 19 L10 13 L16 13 Z' fill='%2300ff41' stroke='%23003300' stroke-width='1'/%3E%3C/svg%3E") 4 4, auto !important;
}
html.theme-dark body.style-cursor-pointer *:not(a):not(button):not([role="button"]):not(input):not(textarea):not(select):not([disabled]) {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 4 L4 18 L8 14 L12 20 L14 19 L10 13 L16 13 Z' fill='%2300ff41' stroke='%23003300' stroke-width='1'/%3E%3C/svg%3E") 4 4, auto !important;
}
/* Dark theme - clickable elements (hand pointer) */
html.theme-dark body.style-cursor-pointer a,
html.theme-dark body.style-cursor-pointer button,
html.theme-dark body.style-cursor-pointer [role="button"],
html.theme-dark body.style-cursor-pointer label[for],
html.theme-dark body.style-cursor-pointer .clickable {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 L12 8 M8 8 L8 14 M16 8 L16 14 M4 10 L4 16 M20 10 L20 14 M6 16 Q6 20 12 20 Q18 20 18 14 L18 10' fill='none' stroke='%2300ff41' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 12 4, pointer !important;
}
/* Dark theme - text selection */
html.theme-dark body.style-cursor-pointer p,
html.theme-dark body.style-cursor-pointer span:not(.option-preview),
html.theme-dark body.style-cursor-pointer h1, html.theme-dark body.style-cursor-pointer h2,
html.theme-dark body.style-cursor-pointer h3, html.theme-dark body.style-cursor-pointer h4 {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='24' viewBox='0 0 16 24'%3E%3Cpath d='M4 4 L12 4 M8 4 L8 20 M4 20 L12 20' fill='none' stroke='%2300ff41' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 8 12, text !important;
}
/* Dark theme - disabled/forbidden */
html.theme-dark body.style-cursor-pointer [disabled],
html.theme-dark body.style-cursor-pointer .disabled {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='%23ff4444' stroke-width='2'/%3E%3Cpath d='M6 6 L18 18' stroke='%23ff4444' stroke-width='2'/%3E%3C/svg%3E") 12 12, not-allowed !important;
}

/* Light theme - default state */
html.theme-light body.style-cursor-pointer {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 4 L4 18 L8 14 L12 20 L14 19 L10 13 L16 13 Z' fill='%238b5a2b' stroke='%23442200' stroke-width='1'/%3E%3C/svg%3E") 4 4, auto !important;
}
html.theme-light body.style-cursor-pointer *:not(a):not(button):not([role="button"]):not(input):not(textarea):not(select):not([disabled]) {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 4 L4 18 L8 14 L12 20 L14 19 L10 13 L16 13 Z' fill='%238b5a2b' stroke='%23442200' stroke-width='1'/%3E%3C/svg%3E") 4 4, auto !important;
}
/* Light theme - clickable */
html.theme-light body.style-cursor-pointer a,
html.theme-light body.style-cursor-pointer button,
html.theme-light body.style-cursor-pointer [role="button"],
html.theme-light body.style-cursor-pointer label[for],
html.theme-light body.style-cursor-pointer .clickable {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 L12 8 M8 8 L8 14 M16 8 L16 14 M4 10 L4 16 M20 10 L20 14 M6 16 Q6 20 12 20 Q18 20 18 14 L18 10' fill='none' stroke='%238b5a2b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 12 4, pointer !important;
}
/* Light theme - text */
html.theme-light body.style-cursor-pointer p,
html.theme-light body.style-cursor-pointer span:not(.option-preview),
html.theme-light body.style-cursor-pointer h1, html.theme-light body.style-cursor-pointer h2,
html.theme-light body.style-cursor-pointer h3, html.theme-light body.style-cursor-pointer h4 {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='24' viewBox='0 0 16 24'%3E%3Cpath d='M4 4 L12 4 M8 4 L8 20 M4 20 L12 20' fill='none' stroke='%238b5a2b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 8 12, text !important;
}
/* Light theme - disabled */
html.theme-light body.style-cursor-pointer [disabled],
html.theme-light body.style-cursor-pointer .disabled {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='%23cc3333' stroke-width='2'/%3E%3Cpath d='M6 6 L18 18' stroke='%23cc3333' stroke-width='2'/%3E%3C/svg%3E") 12 12, not-allowed !important;
}

/* === CROSSHAIR CURSOR === */
html.theme-dark body.style-cursor-crosshair,
html.theme-dark body.style-cursor-crosshair * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cline x1='12' y1='2' x2='12' y2='22' stroke='%2300ff41' stroke-width='2'/%3E%3Cline x1='2' y1='12' x2='22' y2='12' stroke='%2300ff41' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='%2300ff41' stroke-width='1'/%3E%3C/svg%3E") 12 12, crosshair !important;
}
html.theme-light body.style-cursor-crosshair,
html.theme-light body.style-cursor-crosshair * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cline x1='12' y1='2' x2='12' y2='22' stroke='%238b5a2b' stroke-width='2'/%3E%3Cline x1='2' y1='12' x2='22' y2='12' stroke='%238b5a2b' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='%238b5a2b' stroke-width='1'/%3E%3C/svg%3E") 12 12, crosshair !important;
}

/* === DOT CURSOR === */
html.theme-dark body.style-cursor-dot,
html.theme-dark body.style-cursor-dot * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='8' cy='8' r='6' fill='%2300ff41'/%3E%3Ccircle cx='8' cy='8' r='3' fill='%23003300'/%3E%3C/svg%3E") 8 8, auto !important;
}
html.theme-light body.style-cursor-dot,
html.theme-light body.style-cursor-dot * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='8' cy='8' r='6' fill='%238b5a2b'/%3E%3Ccircle cx='8' cy='8' r='3' fill='%23fff8f0'/%3E%3C/svg%3E") 8 8, auto !important;
}

/* ========================================
   TEXT EFFECT STYLES (CSS-only, no layout changes)
======================================== */

/* ========================================
   TEXT HOVER EFFECTS
   Binary and Scramble (Words Changing)
======================================== */

/* Elements that can have text effects */
.text-effect-binary [data-text-effect],
.text-effect-scramble [data-text-effect],
body.text-effect-binary h1,
body.text-effect-binary h2,
body.text-effect-binary h3,
body.text-effect-binary .section-title,
body.text-effect-binary .nav-link,
body.text-effect-binary .project-card h3,
body.text-effect-scramble h1,
body.text-effect-scramble h2,
body.text-effect-scramble h3,
body.text-effect-scramble .section-title,
body.text-effect-scramble .nav-link,
body.text-effect-scramble .project-card h3 {
    cursor: pointer;
    position: relative;
}

/* Binary effect styling */
.text-binary-active {
    font-family: 'Fira Code', 'Consolas', monospace !important;
    letter-spacing: 0.05em;
}

.theme-dark .text-binary-active {
    color: var(--accent) !important;
    text-shadow: 0 0 8px var(--accent);
}

.theme-light .text-binary-active {
    color: #8b5a2b !important;
}

/* Scramble effect styling */
.text-scramble-active {
    font-family: 'Fira Code', 'Consolas', monospace !important;
}

.theme-dark .text-scramble-active {
    color: #00ffff !important;
    text-shadow: 0 0 5px #00ffff;
}

.theme-light .text-scramble-active {
    color: #d2691e !important;
}

/* ========================================
   BACKGROUND EFFECTS (applied to body)
   Note: Matrix and Binary effects are handled via canvas in JS
======================================== */

/* Grid Background */
body.bg-effect-grid::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    background: 
        linear-gradient(rgba(0, 255, 65, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
}

html.theme-light body.bg-effect-grid::after {
    background: 
        linear-gradient(rgba(139, 90, 43, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 90, 43, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Scanlines Background */
body.bg-effect-scanlines::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.04) 2px,
        rgba(0, 255, 65, 0.04) 4px
    );
}

html.theme-light body.bg-effect-scanlines::after {
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(139, 90, 43, 0.05) 2px,
        rgba(139, 90, 43, 0.05) 4px
    );
}

/* ========================================
   MOBILE ADJUSTMENTS
======================================== */
@media (max-width: 768px) {
    .effects-toggle-label {
        display: none;
    }
    
    .effects-header-toggle {
        padding: 8px 10px;
    }
    
    .effects-dropdown-panel {
        width: calc(100vw - 40px);
        right: 20px;
        top: 60px;
    }
    
    .effect-option {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .effects-dropdown-panel {
        width: calc(100vw - 20px);
        right: 10px;
    }
    
    .effect-option {
        width: 36px;
        height: 36px;
    }
    
    .cursor-preview-ring {
        width: 14px;
        height: 14px;
    }
    
    .cursor-preview-crosshair {
        width: 14px;
        height: 14px;
    }
}
