/* Classroomscreen-Style Notepad Tool */
#notepad-tool {
    position: relative;
    width: 400px;
    height: 300px;
    min-width: 200px;
    min-height: 150px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
}

/* Toolbar - shows when tool is selected/active */
#notepad-toolbar {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    display: none;
    z-index: 1000;
    white-space: nowrap;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#notepad-tool.active #notepad-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toolbar sections */
.toolbar-section {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 8px;
    border-right: 1px solid #eee;
}

.toolbar-section:last-child {
    border-right: none;
    padding-right: 0;
}

/* Font family dropdown */
#notepad-font-family {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    min-width: 90px;
    font-family: inherit;
}

/* Font size input */
#notepad-font-size {
    width: 40px;
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    text-align: center;
}

/* Style buttons */
.style-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
}

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

.style-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Alignment buttons */
.align-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
}

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

.align-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Line spacing dropdown */
#notepad-line-spacing {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    min-width: 50px;
}

/* Color picker */
#notepad-text-color {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

/* Background toggle */
#notepad-bg-toggle {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

#notepad-bg-toggle:hover {
    background: #f0f0f0;
}

#notepad-bg-toggle.active {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

/* Delete button */
#notepad-delete {
    width: 28px;
    height: 28px;
    border: 1px solid #dc3545;
    border-radius: 3px;
    background: #fff;
    color: #dc3545;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    margin-left: 4px;
}

#notepad-delete:hover {
    background: #dc3545;
    color: #fff;
}

/* Content area */
#notepad-content {
    flex: 1;
    padding: 20px;
    overflow: hidden;
}

/* Editable text area */
#notepad-text {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-family: 'Quicksand', sans-serif;
    font-size: 28px;
    line-height: 1.2;
    color: #333;
    overflow-y: auto;
    word-wrap: break-word;
}

#notepad-text::placeholder {
    color: #999;
    font-style: italic;
    font-family: 'Quicksand', sans-serif;
}

/* Hide scrollbar but keep functionality */
#notepad-text::-webkit-scrollbar {
    width: 6px;
}

#notepad-text::-webkit-scrollbar-track {
    background: transparent;
}

#notepad-text::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#notepad-text::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #notepad-toolbar {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .toolbar-section {
        gap: 3px;
        padding-right: 6px;
    }
    
    #notepad-text {
        font-size: 24px;
    }
    
    .style-btn,
    .align-btn,
    #notepad-text-color,
    #notepad-bg-toggle,
    #notepad-delete {
        width: 32px;
        height: 32px;
    }
}

/* Print styles */
@media print {
    #notepad-toolbar {
        display: none !important;
    }
    
    #notepad-tool {
        box-shadow: none;
        border: 1px solid #000;
    }
}
