* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== TOOL HEADER STYLES ===== */
.tool-header {
    background: linear-gradient(135deg, #1e293b, var(--primary-color));
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.tool-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.tool-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.security-badge {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #22c55e;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Dark mode tool header */
body.dark-mode .tool-header {
    background: linear-gradient(135deg, var(--bg-dark), var(--primary-color));
}

body.dark-mode .security-badge {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #22c55e;
}

/* Reset for tool-specific styles */
.main-content {
    background: var(--bg-light, #f8f9fa);
    padding-top: 2rem;
    min-height: calc(100vh - 300px);
    transition: background-color 0.4s ease;
}

/* Dark mode main content */
body.dark-mode .main-content {
    background: var(--bg-dark, #0f172a);
}

/* Override container for our floating toolbar */
.main-content .container {
    position: relative;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Floating Toolbar - Estilo macOS/Windows 11 */
.floating-toolbar {
    position: relative;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.6) inset;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    transition: all 0.4s ease;
    margin-bottom: 3rem;
}

/* Dark mode floating toolbar */
body.dark-mode .floating-toolbar {
    background: rgba(15, 23, 42, 0.95);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-group {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-icon {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-size: 20px;
}

.tool-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* Dark mode tool icon hover */
body.dark-mode .tool-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tool-icon.active {
    background: linear-gradient(135deg, var(--accent-color, #4facfe) 0%, var(--accent-secondary, #00f2fe) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

/* Dark mode active tool icon */
body.dark-mode .tool-icon.active {
    background: linear-gradient(135deg, var(--accent-color, #6366f1) 0%, var(--accent-secondary, #3b82f6) 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.tool-icon .icon {
    font-size: 18px;
    line-height: 1;
}

/* Dropdowns */
.dropdown {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 16px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

/* Dark mode dropdown */
body.dark-mode .dropdown {
    background: rgba(15, 23, 42, 0.98);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #333);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: color 0.4s ease;
}

/* Dark mode dropdown header */
body.dark-mode .dropdown-header {
    color: var(--text-color, #e2e8f0);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-option {
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-option label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light, #666);
    transition: color 0.4s ease;
}

/* Dark mode labels */
body.dark-mode .tool-option label {
    color: var(--text-light, #94a3b8);
}

.dropdown-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-color, #333);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dark mode dropdown buttons */
body.dark-mode .dropdown-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color, #e2e8f0);
}

.dropdown-btn:hover {
    background: rgba(79, 172, 254, 0.1);
    color: var(--accent-color, #4facfe);
    transform: translateY(-1px);
}

/* Dark mode dropdown button hover */
body.dark-mode .dropdown-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-color, #6366f1);
}

/* Estilos específicos para botões */
.save-style:hover {
    background: rgba(67, 160, 71, 0.1) !important;
    color: #43a047 !important;
}

.export-style:hover {
    background: rgba(255, 112, 67, 0.1) !important;
    color: #ff7043 !important;
}

.delete-style:hover {
    background: rgba(245, 124, 0, 0.1) !important;
    color: #f57c00 !important;
}

.danger-style:hover {
    background: rgba(229, 57, 53, 0.1) !important;
    color: #e53935 !important;
}

/* Color Picker */
#colorPicker {
    width: 60px;
    height: 32px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

/* Brush Size */
#brushSize {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.1);
    outline: none;
    -webkit-appearance: none;
}

#brushSize::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4facfe;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79, 172, 254, 0.3);
}

#brushSizeValue {
    font-weight: 600;
    color: #4facfe;
    font-size: 14px;
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin: 8px 0;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.zoom-btn:hover {
    background: rgba(79, 172, 254, 0.2);
    transform: translateY(-1px);
}

#zoomDisplay {
    font-weight: 600;
    color: var(--text-color, #333);
    font-size: 14px;
    min-width: 45px;
    text-align: center;
    transition: color 0.4s ease;
}

/* Dark mode zoom display */
body.dark-mode #zoomDisplay {
    color: var(--text-color, #e2e8f0);
}

/* Canvas Container */
.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: transparent;
    min-height: 500px;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

#whiteboard {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    background: white;
}

/* Features, Instructions and Shortcuts Sections */
.features-section,
.instructions-section,
.shortcuts-section {
    padding: 3rem 0;
    background: var(--bg-color, white);
    margin-bottom: 0;
    transition: background-color 0.4s ease;
}

.features-section:nth-child(odd),
.instructions-section:nth-child(odd),
.shortcuts-section:nth-child(odd) {
    background: var(--bg-light, #f8f9fa);
}

/* Dark mode sections */
body.dark-mode .features-section,
body.dark-mode .instructions-section,
body.dark-mode .shortcuts-section {
    background: var(--bg-color, #1e293b);
}

body.dark-mode .features-section:nth-child(odd),
body.dark-mode .instructions-section:nth-child(odd),
body.dark-mode .shortcuts-section:nth-child(odd) {
    background: var(--bg-dark, #0f172a);
}

.features-grid,
.instructions-grid,
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card,
.instruction-step {
    background: var(--bg-color, white);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.features-section:nth-child(odd) .feature-card {
    background: var(--bg-color, white);
}

/* Dark mode cards */
body.dark-mode .feature-card,
body.dark-mode .instruction-step {
    background: var(--bg-color, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .features-section:nth-child(odd) .feature-card {
    background: var(--bg-color, #1e293b);
}

.feature-card:hover,
.instruction-step:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon,
.step-number {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color, #4facfe);
    transition: color 0.4s ease;
}

/* Dark mode icons */
body.dark-mode .feature-icon,
body.dark-mode .step-number {
    color: var(--accent-color, #6366f1);
}

.step-number {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-weight: 600;
}

.feature-card h3,
.instruction-step h3 {
    color: var(--text-color, #333);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    transition: color 0.4s ease;
}

/* Dark mode headings */
body.dark-mode .feature-card h3,
body.dark-mode .instruction-step h3 {
    color: var(--text-color, #e2e8f0);
}

.feature-card p,
.instruction-step p {
    color: var(--text-light, #666);
    line-height: 1.6;
    font-size: 1rem;
    transition: color 0.4s ease;
}

/* Dark mode text */
body.dark-mode .feature-card p,
body.dark-mode .instruction-step p {
    color: var(--text-light, #94a3b8);
}

/* Shortcuts Grid */
.shortcuts-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-color, white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.shortcuts-section:nth-child(odd) .shortcut-item {
    background: var(--bg-color, white);
}

/* Dark mode shortcut items */
body.dark-mode .shortcut-item {
    background: var(--bg-color, #1e293b);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .shortcuts-section:nth-child(odd) .shortcut-item {
    background: var(--bg-color, #1e293b);
}

.shortcut-item kbd {
    background: var(--bg-light, #f1f3f4);
    border: 1px solid var(--border-color, #dadce0);
    border-radius: 4px;
    color: var(--text-color, #3c4043);
    font-family: monospace;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    transition: all 0.4s ease;
}

/* Dark mode kbd */
body.dark-mode .shortcut-item kbd {
    background: var(--bg-dark, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color, #e2e8f0);
}

.shortcut-item span {
    color: var(--text-light, #666);
    flex: 1;
    transition: color 0.4s ease;
}

/* Dark mode shortcut text */
body.dark-mode .shortcut-item span {
    color: var(--text-light, #94a3b8);
}

/* Section titles styling */
.features-section h2,
.instructions-section h2,
.shortcuts-section h2 {
    color: var(--text-color, #1e293b);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    transition: color 0.4s ease;
}

/* Dark mode section titles */
body.dark-mode .features-section h2,
body.dark-mode .instructions-section h2,
body.dark-mode .shortcuts-section h2 {
    color: var(--text-color, #e2e8f0);
}

/* Canvas border dark mode compatibility */
body.dark-mode #whiteboard {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

/* Dropdown arrow dark mode */
body.dark-mode .dropdown::before {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-right: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .floating-toolbar {
        position: static;
        transform: none;
        margin: 2rem auto;
        justify-content: center;
        flex-wrap: wrap;
    }

    .canvas-container {
        padding-top: 2rem;
    }

    #whiteboard {
        width: 100%;
        max-width: 800px;
        height: auto;
    }

    .features-grid,
    .instructions-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {

    .floating-toolbar {
        padding: 10px 12px;
        border-radius: 12px;
        gap: 6px;
    }

    .tool-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .dropdown {
        min-width: 260px;
        padding: 14px;
    }

    .canvas-container {
        padding: 20px 15px;
    }

    #whiteboard {
        border-width: 1px;
        border-radius: 8px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .floating-toolbar {
        width: 100%;
        padding: 8px;
        border-radius: 10px;
    }

    .tool-icon {
        width: 40px;
        height: 40px;
    }

    .dropdown {
        min-width: 240px;
        left: 0;
        right: 0;
        margin: 0 auto;
        transform: translateX(0) translateY(-10px);
    }

    .dropdown.show {
        transform: translateX(0) translateY(0);
    }
}

/* Animation for dropdown arrow */
.dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: none;
    border-right: none;
    transform: translateX(-50%) rotate(45deg);
    z-index: -1;
}

/* Smooth transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Disable text selection on toolbar */
.floating-toolbar {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}