/* ===== Base Styles ===== */
body.klassitahvel-body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#app-container {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    display: flex;
    flex-direction: column;
}

#widget-area {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: calc(100% - 90px);
    overflow: hidden;
}

/* ===== Control Buttons ===== */
/* Legacy control-btn kept for view.php buttons */
.control-btn {
    position: fixed;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* view.php still uses these IDs */
#home-btn { top: 20px; left: 20px; }
#library-btn { top: 20px; left: 80px; background: rgba(72,120,200,0.95); color: white; }
#copy-btn { top: 20px; left: 140px; background: rgba(72,199,142,0.95); color: white; }
#fullscreen-btn { top: 20px; right: 20px; }

/* ===== Control Menu (board.php) ===== */

.control-menu {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.control-menu-trigger {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(30, 30, 46, 0.9);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.control-menu-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.control-menu-items {
    position: absolute;
    top: 56px;
    left: 0;
    min-width: 200px;
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 6px 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.control-menu-items::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 60px;
    height: 10px;
}

.control-menu:hover .control-menu-items,
.control-menu.open .control-menu-items {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.control-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s;
    white-space: nowrap;
    font-family: inherit;
    box-sizing: border-box;
}

.control-menu-item:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.control-menu-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.control-menu-item.danger {
    color: rgba(255,120,120,0.9);
}

.control-menu-item.danger:hover {
    background: rgba(255,80,80,0.15);
    color: #ff6b6b;
}

.control-menu-item.active {
    background: rgba(0, 209, 178, 0.15);
    color: #00d1b2;
}

.control-menu-item.hidden {
    display: none;
}

.control-menu-item.active {
    color: #00d1b2;
}

.control-menu-separator {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 4px 12px;
}

/* ===== Toolbar ===== */
#toolbar {
    height: 90px;
    background-color: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    padding: 0 20px;
    backdrop-filter: blur(10px);
}

.toolbar-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    width: 100%;
    justify-content: center;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.toolbar-scroll::-webkit-scrollbar {
    height: 6px;
}

.toolbar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.toolbar-scroll::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.tool-btn {
    border: none;
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
    min-width: 60px;
    flex-shrink: 0;
}

.tool-btn:hover {
    background: linear-gradient(145deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tool-btn:active {
    transform: translateY(0);
}

.tool-btn i {
    font-size: 22px;
    margin-bottom: 6px;
    color: #00d1b2;
}

.tool-btn span {
    font-size: 11px;
    font-weight: 500;
    color: #555;
}

/* ===== Background Panel ===== */
#background-panel {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 320px;
    max-height: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    z-index: 1001;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#background-panel.hidden {
    display: none;
}

.bg-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.bg-panel-header h4 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.close-panel {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close-panel:hover {
    color: #333;
}

.bg-options {
    padding: 15px 20px;
    max-height: 320px;
    overflow-y: auto;
}

.bg-section {
    margin-bottom: 20px;
}

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

.bg-section h5 {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.color-options, .image-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.color-btn, .img-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-size: cover;
    background-position: center;
}

.color-btn:hover, .img-btn:hover {
    transform: scale(1.1);
    border-color: #00d1b2;
}

#custom-bg-input {
    display: none;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #00d1b2;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background: #00b89c;
}

/* ===== Widgets Base ===== */
.widget {
    position: absolute;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    min-width: 220px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    transition: box-shadow 0.2s ease;
}

.widget:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.widget-header {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 15px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #eee;
    user-select: none;
}

.widget-header i {
    color: #00d1b2;
    font-size: 14px;
}

.widget-title {
    flex-grow: 1;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.close-btn {
    cursor: pointer;
    font-weight: bold;
    color: #999;
    font-size: 20px;
    line-height: 1;
    padding: 0 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.widget-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.widget-footer {
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* ===== Widget Extras (collapsible) ===== */
.extras-toggle {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px 0;
    color: #aaa;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.extras-toggle:hover {
    color: #666;
}

.extras-toggle i {
    transition: transform 0.2s ease;
}

.extras-toggle.open i {
    transform: rotate(180deg);
}

.widget-extras {
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    max-height: 300px;
    opacity: 1;
}

.widget-extras.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

/* ===== Text Widget ===== */
.widget-text {
    min-width: 280px;
    min-height: 200px;
}

.widget-text textarea {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    padding: 0;
}

.font-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.font-btn:hover {
    background: #00d1b2;
    color: white;
    border-color: #00d1b2;
}

.font-size-display {
    font-size: 12px;
    color: #666;
    min-width: 35px;
    text-align: center;
}

/* ===== Timer Widget ===== */
.widget-timer {
    min-width: 280px;
}

.widget-timer .timer-display {
    font-size: 56px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-bottom: 15px;
    color: #333;
    cursor: text;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.widget-timer .timer-display:hover {
    background: #f0f0f0;
}

.widget-timer .timer-display:focus {
    outline: 2px solid #00d1b2;
    background: #f8f8f8;
}

.widget-timer.alarm .timer-display {
    animation: timerAlarm 0.5s ease-in-out infinite;
    color: #ff4444;
}

@keyframes timerAlarm {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer-controls, .timer-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.timer-controls {
    margin-bottom: 12px;
}

.timer-controls button, .timer-presets button {
    padding: 8px 14px;
    cursor: pointer;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.timer-controls button:hover, .timer-presets button:hover {
    background: #00d1b2;
    color: white;
    border-color: #00d1b2;
}

.timer-play {
    background: #00d1b2 !important;
    color: white !important;
    border-color: #00d1b2 !important;
}

.timer-play:hover {
    background: #00b89c !important;
}

/* ===== Stopwatch Widget ===== */
.widget-stopwatch {
    min-width: 280px;
}

.stopwatch-display {
    font-size: 48px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-bottom: 15px;
    color: #333;
}

.stopwatch-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.stopwatch-controls button {
    padding: 8px 14px;
    cursor: pointer;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.stopwatch-controls button:hover {
    background: #00d1b2;
    color: white;
    border-color: #00d1b2;
}

.stopwatch-play {
    background: #00d1b2 !important;
    color: white !important;
    border-color: #00d1b2 !important;
}

.stopwatch-laps {
    max-height: 100px;
    overflow-y: auto;
    width: 100%;
    font-size: 13px;
    color: #666;
}

.stopwatch-lap {
    padding: 4px 10px;
    background: #f8f8f8;
    border-radius: 4px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

/* ===== Clock Widget ===== */
.widget-clock {
    min-width: 220px;
}

.clock-display {
    font-size: 52px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #333;
}

.clock-date {
    font-size: 16px;
    color: #888;
    margin-top: 8px;
}

/* ===== Traffic Light Widget ===== */
.widget-traffic-light {
    min-width: 120px;
    min-height: 260px;
}

.traffic-light-content {
    background-color: #2d3436;
    padding: 15px !important;
    border-radius: 12px;
    gap: 12px;
}

.light {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #1a1a1a;
}

.light:hover {
    transform: scale(1.05);
}

.light.red.active { 
    background-color: #ff4444; 
    box-shadow: 0 0 30px #ff4444, 0 0 60px rgba(255, 68, 68, 0.5); 
}
.light.yellow.active { 
    background-color: #ffbb33; 
    box-shadow: 0 0 30px #ffbb33, 0 0 60px rgba(255, 187, 51, 0.5); 
}
.light.green.active { 
    background-color: #00C851; 
    box-shadow: 0 0 30px #00C851, 0 0 60px rgba(0, 200, 81, 0.5); 
}

/* ===== Work Symbols Widget ===== */
.widget-work-symbols {
    min-width: 280px;
}

.work-symbols-content {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px !important;
}

.work-symbol {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 2px solid #eee;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.work-symbol i {
    font-size: 24px;
    color: #888;
    transition: all 0.2s;
}

.work-symbol span {
    font-size: 11px;
    color: #666;
    text-align: center;
}

.work-symbol:hover {
    border-color: #00d1b2;
    background: #f8ffff;
}

.work-symbol.active {
    background: linear-gradient(145deg, #00d1b2 0%, #00b89c 100%);
    border-color: transparent;
}

.work-symbol.active i,
.work-symbol.active span {
    color: white;
}

/* Expanded work symbol */
.widget-work-symbols.expanded {
    min-width: 300px;
    min-height: 300px;
}

.widget-work-symbols.expanded .work-symbols-content {
    display: flex !important;
    flex-direction: column;
    padding: 0 !important; /* Remove padding to fill widget */
    height: 100%;
}

.widget-work-symbols.expanded .work-symbol.active {
    flex: 1;
    font-size: 24px;
    border: none;
    border-radius: 0;
    margin: 0;
    justify-content: center;
}

.widget-work-symbols.expanded .work-symbol.active i {
    font-size: 100px; /* Larger icon */
    margin-bottom: 20px;
}

.widget-work-symbols.expanded .work-symbol.active span {
    font-size: 28px; /* Larger text */
    font-weight: 600;
}

.widget-work-symbols.expanded .work-symbol:not(.active) {
    display: none;
}

/* ===== Random Picker Widget ===== */
.widget-random-picker {
    min-width: 280px;
    min-height: 300px;
}

.picker-names {
    width: 100%;
    height: 100px;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.picker-names:focus {
    outline: none;
    border-color: #00d1b2;
}

.picker-result {
    font-size: 32px;
    font-weight: 700;
    color: #00d1b2;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.picker-result.animating {
    animation: pickerSpin 0.1s linear infinite;
}

@keyframes pickerSpin {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.picker-btn {
    padding: 12px 24px;
    background: linear-gradient(145deg, #00d1b2 0%, #00b89c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.picker-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 209, 178, 0.4);
}

.picker-history {
    margin-top: 15px;
    font-size: 12px;
    color: #888;
    text-align: center;
    max-height: 60px;
    overflow-y: auto;
}

/* ===== Dice Widget ===== */
.widget-dice {
    min-width: 240px;
}

.dice-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.dice {
    width: 60px;
    height: 60px;
    background: white;
    border: 3px solid #333;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.dice:hover {
    transform: scale(1.1);
}

.dice.rolling {
    animation: diceRoll 0.3s ease infinite;
}

@keyframes diceRoll {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

.dice-face {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.dice-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.dice-controls button {
    padding: 8px 14px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dice-controls button:hover {
    background: #00d1b2;
    color: white;
    border-color: #00d1b2;
}

.roll-btn {
    background: #00d1b2 !important;
    color: white !important;
    border-color: #00d1b2 !important;
}

.dice-total {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.dice-total span {
    color: #00d1b2;
}

/* ===== Drawing Widget ===== */
.widget-drawing {
    min-width: 450px;
    min-height: 400px;
}

.drawing-content {
    padding: 10px !important;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
}

.drawing-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.drawing-toolbar .color-picker {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.drawing-toolbar .size-slider {
    width: 80px;
}

.drawing-toolbar button {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.drawing-toolbar button:hover {
    background: #f0f0f0;
}

.drawing-toolbar button.active {
    background: #00d1b2;
    color: white;
    border-color: #00d1b2;
}

.drawing-canvas {
    border: 2px solid #eee;
    border-radius: 10px;
    background: white;
    cursor: crosshair;
    width: 100%;
    height: auto;
    flex: 1;
    touch-action: none;
}

/* ===== Noise Meter Widget ===== */
.widget-noise-meter {
    min-width: 250px;
}

.noise-meter-display {
    width: 100%;
    margin-bottom: 15px;
}

.noise-bar {
    width: 100%;
    height: 24px;
    background: linear-gradient(90deg, #00C851 0%, #ffbb33 50%, #ff4444 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.noise-level {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: rgba(255,255,255,0.9);
    width: 100%;
    transition: width 0.1s ease;
}

.noise-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.noise-icon {
    font-size: 24px;
    color: #00C851;
}

.noise-text {
    font-weight: 600;
    color: #333;
}

.noise-start-btn {
    padding: 12px 24px;
    background: linear-gradient(145deg, #00d1b2 0%, #00b89c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.noise-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 209, 178, 0.4);
}

.noise-start-btn.active {
    background: linear-gradient(145deg, #ff4444 0%, #cc0000 100%);
}

.noise-threshold {
    margin-top: 15px;
    font-size: 13px;
    color: #666;
}

.noise-threshold label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.noise-threshold input {
    flex: 1;
}

/* ===== QR Code Widget ===== */
.widget-qr-code {
    min-width: 250px;
}

.qr-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.qr-input:focus {
    outline: none;
    border-color: #00d1b2;
}

.qr-display {
    display: flex;
    justify-content: center;
    min-height: 128px;
}

.qr-display img {
    border-radius: 8px;
}

/* ===== Image Widget ===== */
.widget-image {
    min-width: 280px;
    min-height: 220px;
}

.image-content {
    padding: 10px !important;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 150px;
    border: 3px dashed #ddd;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #999;
}

.image-placeholder:hover {
    border-color: #00d1b2;
    color: #00d1b2;
}

.image-placeholder i {
    font-size: 40px;
}

.image-placeholder span {
    font-size: 14px;
}

.image-display {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

/* ===== Responsive ===== */
@media screen and (max-width: 768px) {
    #toolbar {
        height: 80px;
        padding: 0 10px;
    }

    .toolbar-scroll {
        justify-content: flex-start;
    }

    .tool-btn {
        padding: 10px 12px;
        min-width: 60px;
    }

    .tool-btn i {
        font-size: 20px;
    }

    .tool-btn span {
        font-size: 10px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .control-menu {
        top: 10px;
        left: 10px;
    }

    .control-menu-trigger {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .control-menu-items {
        top: 50px;
        min-width: 180px;
    }

    .widget {
        min-width: 180px;
    }

    #background-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
}

/* ===== Animations ===== */
.widget {
    animation: widgetAppear 0.3s ease;
}

@keyframes widgetAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Touch improvements ===== */
@media (hover: none) {
    .tool-btn:hover {
        transform: none;
        box-shadow: none;
    }

    .control-btn:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
}

/* ===== Shake animation for noise meter ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== Empty state ===== */
#widget-area:empty::after {
    content: 'Vali altpoolt tööriistaribalt vidin';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* ===== Timer alarm visual ===== */
.widget-timer.alarm {
    animation: alarmPulse 0.5s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.6);
}

@keyframes alarmPulse {
    0%, 100% { 
        box-shadow: 0 8px 32px rgba(255, 68, 68, 0.4);
    }
    50% { 
        box-shadow: 0 8px 50px rgba(255, 68, 68, 0.8);
    }
}

/* ===== Improved mobile layout ===== */
@media screen and (max-width: 480px) {
    .widget {
        min-width: 150px !important;
    }
    
    .timer-display, .stopwatch-display, .clock-display {
        font-size: 32px !important;
    }
    
    .picker-result {
        font-size: 24px !important;
    }
    
    .work-symbols-content {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .dice {
        width: 50px !important;
        height: 50px !important;
    }
    
    .dice-face {
        font-size: 22px !important;
    }
}

/* ===== Loading animation for widgets ===== */
.widget.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* ===== Better scrollbar for laps ===== */
.stopwatch-laps::-webkit-scrollbar {
    width: 4px;
}

.stopwatch-laps::-webkit-scrollbar-track {
    background: transparent;
}

.stopwatch-laps::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* ===== Dark mode support ===== */
@media (prefers-color-scheme: dark) {
    .widget {
        background: #1e1e1e;
        color: #eee;
    }
    
    .widget-header {
        background: linear-gradient(145deg, #2d2d2d 0%, #252525 100%);
        border-bottom-color: #333;
    }
    
    .widget-title {
        color: #eee;
    }
    
    .widget-footer {
        background: #252525;
        border-top-color: #333;
    }
    
    .widget-text textarea,
    .picker-names,
    .qr-input {
        background: #2d2d2d;
        color: #eee;
        border-color: #444;
    }
    
    .timer-display,
    .stopwatch-display,
    .clock-display {
        color: #eee;
    }
    
    .clock-date {
        color: #999;
    }
    
    .font-btn,
    .timer-controls button,
    .timer-presets button,
    .stopwatch-controls button,
    .dice-controls button {
        background: #333;
        border-color: #444;
        color: #eee;
    }
    
    .font-size-display {
        color: #999;
    }
    
    .work-symbol {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .work-symbol span {
        color: #ccc;
    }
    
    .dice {
        background: #2d2d2d;
        border-color: #eee;
    }
    
    .dice-face {
        color: #eee;
    }
    
    .dice-total {
        color: #eee;
    }
    
    .image-placeholder {
        border-color: #444;
        color: #666;
    }
}

/* ===== Annotation Overlay ===== */
.annotation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 90px);
    z-index: 998;
    pointer-events: auto;
    cursor: crosshair;
}

.annotation-overlay.hidden {
    display: none;
}

.annotation-overlay canvas {
    width: 100%;
    height: 100%;
}

.annotation-toolbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 1002;
}

.annotation-toolbar.hidden {
    display: none;
}

.annotation-toolbar input[type="color"] {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.annotation-toolbar input[type="range"] {
    width: 80px;
}

.annotation-toolbar button {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.annotation-toolbar button:hover {
    background: #f0f0f0;
}

.annotation-toolbar button.active {
    background: #00d1b2;
    color: white;
    border-color: #00d1b2;
}

.annotation-toolbar .close-annotation {
    background: #ff4444;
    color: white;
    border-color: #ff4444;
}

.annotation-toolbar .close-annotation:hover {
    background: #cc0000;
}

/* annotate-btn is now inside the control-menu */
#annotate-btn.active {
    color: #00d1b2;
}

/* ===== Analog Clock ===== */
.clock-toggle-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clock-toggle-btn:hover {
    color: #00d1b2;
    background: rgba(0, 209, 178, 0.1);
}

.clock-content {
    min-height: 180px;
}

.clock-analog {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.analog-clock-face {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
    border: 4px solid #333;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 2px 10px rgba(0,0,0,0.05);
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 3px;
}

.hour-hand {
    width: 6px;
    height: 50px;
    background: #333;
    transform: translateX(-50%);
}

.minute-hand {
    width: 4px;
    height: 70px;
    background: #555;
    transform: translateX(-50%);
}

.second-hand {
    width: 2px;
    height: 80px;
    background: #ff4444;
    transform: translateX(-50%);
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #333;
    border-radius: 50%;
    z-index: 10;
}

.clock-numbers {
    position: absolute;
    width: 100%;
    height: 100%;
}

.clock-numbers span {
    position: absolute;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clock-numbers span:nth-child(1) { top: 10%; left: 65%; }
.clock-numbers span:nth-child(2) { top: 22%; left: 78%; }
.clock-numbers span:nth-child(3) { top: 42%; left: 85%; }
.clock-numbers span:nth-child(4) { top: 62%; left: 78%; }
.clock-numbers span:nth-child(5) { top: 75%; left: 65%; }
.clock-numbers span:nth-child(6) { top: 82%; left: 45%; }
.clock-numbers span:nth-child(7) { top: 75%; left: 22%; }
.clock-numbers span:nth-child(8) { top: 62%; left: 8%; }
.clock-numbers span:nth-child(9) { top: 42%; left: 2%; }
.clock-numbers span:nth-child(10) { top: 22%; left: 5%; }
.clock-numbers span:nth-child(11) { top: 10%; left: 20%; }
.clock-numbers span:nth-child(12) { top: 2%; left: 42%; }

.analog-date {
    font-size: 14px;
    color: #888;
}

/* ===== Video Widget ===== */
.widget-video {
    min-width: 400px;
    min-height: 300px;
}

.video-content {
    padding: 10px !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-input-container {
    width: 100%;
}

.video-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 13px;
    transition: border-color 0.2s;
}

.video-input:focus {
    outline: none;
    border-color: #00d1b2;
}

.video-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ccc;
    min-height: 180px;
}

.video-placeholder i {
    font-size: 60px;
    color: #ff0000;
    opacity: 0.3;
}

.video-placeholder span {
    font-size: 14px;
    color: #999;
}

.video-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ff6b6b;
    min-height: 180px;
    text-align: center;
    padding: 20px;
}

.video-error i {
    font-size: 40px;
}

.video-error span {
    font-size: 14px;
}

.video-container {
    flex: 1;
    min-height: 200px;
}

.video-iframe {
    width: 100%;
    height: 100%;
    min-height: 200px;
    border-radius: 8px;
}

/* ===== Timetable Widget ===== */
.widget-timetable {
    min-width: 280px;
    min-height: 350px;
}

.timetable-content {
    padding: 10px !important;
}

.timetable-grid {
    width: 100%;
}

.timetable-row {
    display: flex;
    border-bottom: 1px solid #eee;
    transition: all 0.2s;
}

.timetable-row:last-child {
    border-bottom: none;
}

.timetable-header-row {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.timetable-header-row .timetable-time-cell,
.timetable-header-row .timetable-lesson-cell {
    padding: 10px;
}

.timetable-time-cell {
    width: 70px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.timetable-lesson-cell {
    flex: 1;
    display: flex;
    align-items: center;
}

.time-input {
    width: 60px;
    padding: 8px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #00d1b2;
    background: transparent;
    text-align: center;
    transition: all 0.2s;
}

.time-input:focus {
    outline: none;
    border-color: #00d1b2;
    background: white;
}

.lesson-input {
    width: 100%;
    padding: 10px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    background: transparent;
    transition: all 0.2s;
}

.lesson-input:focus {
    outline: none;
    border-color: #00d1b2;
    background: white;
}

.timetable-row.current-lesson {
    background: linear-gradient(90deg, rgba(0, 209, 178, 0.15) 0%, rgba(0, 209, 178, 0.05) 100%);
    border-left: 3px solid #00d1b2;
}

.timetable-row.current-lesson .time-input {
    color: #00d1b2;
    font-weight: 700;
}

.timetable-row.current-lesson .lesson-input {
    font-weight: 600;
}

.timetable-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.timetable-add-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timetable-add-btn:hover {
    background: #00d1b2;
    color: white;
    border-color: #00d1b2;
}

.timetable-del-cell {
    width: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timetable-del-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
}

.timetable-del-btn:hover {
    color: #f14668;
    background: rgba(241, 70, 104, 0.1);
}

.timetable-header-row .timetable-del-cell {
    visibility: hidden;
}

/* ===== Responsive adjustments for new widgets ===== */
@media screen and (max-width: 768px) {
    .annotation-toolbar {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        transform: none;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .widget-video {
        min-width: 280px !important;
    }
    
    .analog-clock-face {
        width: 140px;
        height: 140px;
    }
    
    .hour-hand { height: 40px; }
    .minute-hand { height: 55px; }
    .second-hand { height: 60px; }
    
    .clock-numbers span {
        font-size: 11px;
    }
}

/* ===== Dark mode for new widgets ===== */
@media (prefers-color-scheme: dark) {
    .annotation-toolbar {
        background: #2d2d2d;
    }
    
    .annotation-toolbar button {
        background: #333;
        border-color: #444;
        color: #eee;
    }
    
    .analog-clock-face {
        background: linear-gradient(145deg, #2d2d2d 0%, #252525 100%);
        border-color: #eee;
    }
    
    .clock-hand.hour-hand,
    .clock-hand.minute-hand {
        background: #eee;
    }
    
    .clock-center {
        background: #eee;
    }
    
    .clock-numbers span {
        color: #eee;
    }
    
    .video-input {
        background: #2d2d2d;
        color: #eee;
        border-color: #444;
    }
    
    .timetable-header-row {
        background: #333;
    }
    
    .timetable-row {
        border-color: #444;
    }
    
    .time-input,
    .lesson-input {
        color: #eee;
    }
    
    .timetable-add-btn {
        background: #333;
        border-color: #444;
        color: #eee;
    }

    .timetable-del-btn {
        color: #666;
    }

    .timetable-del-btn:hover {
        color: #f14668;
        background: rgba(241, 70, 104, 0.15);
    }
}

/* ===== Minimized State ===== */
.widget.minimized {
    min-height: auto !important;
    height: auto !important;
    resize: none !important;
}

.widget.minimized .widget-content,
.widget.minimized .widget-footer,
.widget.minimized .extras-toggle,
.widget.minimized .widget-extras {
    display: none !important;
}

.minimize-btn {
    cursor: pointer;
    font-weight: bold;
    color: #999;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    background: none;
    border: none;
    margin-right: 5px;
}

.minimize-btn:hover {
    color: #333;
    background: rgba(0,0,0,0.05);
}

/* ===== Timer Options ===== */
.timer-options {
    margin-bottom: 12px;
    width: 100%;
}

.timer-sound-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    background-color: white;
    cursor: pointer;
}

.timer-sound-select:focus {
    outline: none;
    border-color: #00d1b2;
}

/* ===== Picker Options ===== */
.picker-options {
    margin-bottom: 15px;
    width: 100%;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    justify-content: center;
}

.checkbox-label input {
    cursor: pointer;
}

/* ===== Widget Manager ===== */
#widget-manager {
    position: fixed;
    bottom: 100px;
    left: 20px;
    width: 300px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    z-index: 1001;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 60vh;
}

#widget-manager.hidden {
    display: none;
}

.manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.manager-header h4 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.manager-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.manager-empty-state {
    padding: 30px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.widget-list-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

.widget-list-item:hover {
    background: #f8f9fa;
}

.widget-list-item i {
    width: 20px;
    text-align: center;
    color: #00d1b2;
}

.widget-list-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.widget-list-actions {
    display: flex;
    gap: 5px;
}

.widget-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.widget-action-btn:hover {
    background: #eee;
    color: #333;
}

.widget-action-btn.delete:hover {
    background: #ffecec;
    color: #ff4444;
}

.manager-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.manager-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.manager-btn:hover {
    background: #f0f0f0;
}

.manager-btn.danger {
    color: #ff4444;
    border-color: #ffcdcd;
}

.manager-btn.danger:hover {
    background: #ffecec;
}

.toolbar-separator {
    width: 1px;
    background: #ddd;
    margin: 0 5px;
    height: 40px;
    align-self: center;
}

/* Dark mode for manager */
@media (prefers-color-scheme: dark) {
    #widget-manager {
        background: #1e1e1e;
    }
    
    .manager-header, .manager-footer {
        background: #2d2d2d;
        border-color: #333;
    }
    
    .manager-header h4, .widget-list-name {
        color: #eee;
    }
    
    .widget-list-item {
        border-color: #333;
    }
    
    .widget-list-item:hover {
        background: #2d2d2d;
    }
    
    .manager-btn {
        background: #333;
        border-color: #444;
        color: #eee;
    }
    
    .manager-btn:hover {
        background: #444;
    }
    
    .toolbar-separator {
        background: #444;
    }

    .kt-modal-content {
        background: #1e1e1e;
        color: #eee;
    }
    .kt-modal-header {
        border-color: #333;
    }
    .kt-modal-footer {
        border-color: #333;
    }
    .kt-form-group input,
    .kt-form-group textarea,
    .kt-form-group select {
        background: #2d2d2d;
        border-color: #444;
        color: #eee;
    }
    .kt-panel {
        background: #1e1e1e;
        border-color: #333;
    }
    .kt-panel-header {
        border-color: #333;
    }
    .kt-board-item {
        border-color: #333;
    }
    .kt-board-item:hover {
        background: #2d2d2d;
    }
}

/* ===== Save/Load/Share Modal Styles ===== */

.kt-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kt-modal.hidden {
    display: none;
}

.kt-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.kt-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: ktModalIn 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes ktModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.kt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.kt-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.kt-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    line-height: 1;
}

.kt-modal-close:hover {
    color: #333;
}

.kt-modal-body {
    padding: 20px;
}

.kt-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.kt-form-group {
    margin-bottom: 16px;
}

.kt-form-group:last-child {
    margin-bottom: 0;
}

.kt-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #555;
}

.kt-form-group input[type="text"],
.kt-form-group textarea,
.kt-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.kt-form-group input[type="text"]:focus,
.kt-form-group textarea:focus,
.kt-form-group select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.15);
}

.kt-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.kt-share-link-row {
    display: flex;
    gap: 8px;
}

.kt-share-link-row input {
    flex: 1;
    background: #f5f5f5;
}

.kt-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal !important;
}

.kt-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.kt-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-family: inherit;
}

.kt-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.kt-btn-primary {
    background: #4facfe;
    color: white;
}

.kt-btn-primary:hover:not(:disabled) {
    background: #3a9cee;
}

.kt-btn-secondary {
    background: #e8e8e8;
    color: #555;
}

.kt-btn-secondary:hover {
    background: #ddd;
}

/* ===== My Boards Panel ===== */

.kt-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 350px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: ktModalIn 0.2s ease;
}

.kt-panel.hidden {
    display: none;
}

.kt-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.kt-panel-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.kt-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.kt-board-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.kt-board-item:hover {
    background: #f5f7ff;
    border-color: #c8d6ff;
}

.kt-board-item.active {
    background: #eef3ff;
    border-color: #4facfe;
}

.kt-board-item-info {
    flex: 1;
    min-width: 0;
}

.kt-board-item-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kt-board-item-meta {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.kt-badge-public {
    background: #e3f8e3;
    color: #2e7d32;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
}

.kt-board-item-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
}

.kt-board-item-actions button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.15s;
}

.kt-board-item-actions button:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.kt-board-item-actions button.danger:hover {
    background: #fde8e8;
    border-color: #f14668;
    color: #f14668;
}

.kt-loading {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 14px;
}

.kt-empty-state {
    text-align: center;
    padding: 30px;
    color: #aaa;
}

.kt-empty-state i {
    font-size: 32px;
    margin-bottom: 10px;
}

.kt-empty-state p {
    font-size: 13px;
}

/* ===== Board Title Bar ===== */

#board-title-bar {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 999;
    pointer-events: none;
    white-space: nowrap;
    max-width: 50vw;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(4px);
}

#board-title-bar.hidden {
    display: none;
}

/* View mode title bar */
.view-title-bar {
    display: flex !important;
    gap: 12px;
    align-items: center;
}

.view-title {
    font-weight: 600;
}

.view-meta {
    font-size: 11px;
    opacity: 0.8;
}

/* ===== Toast Notification ===== */

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

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

/* ===== Responsive adjustments for panels ===== */

@media (max-width: 600px) {
    .kt-panel {
        width: calc(100vw - 20px);
        left: 10px;
        right: 10px;
    }
    
    .kt-modal-content {
        width: 95%;
    }
}
