:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-bg: #f5f6fa;
    --dark-text: #2c3e50;
    --light-text: #ecf0f1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: var(--primary-color);
}

/* Ribbon Options */
.ribbon {
    display: flex;
    gap: 15px;
    align-items: center;
}

.ribbon-item {
    cursor: pointer;
    color: #555;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 4px;
}

.ribbon-item:hover {
    background-color: #f0f0f0;
}

.action-btn {
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.action-btn:hover {
    background: #f1f1f1;
}

.btn-export {
    background-color: var(--secondary-color);
    color: white;
    border: none;
}

/* App Layout */
.app-layout {
    display: flex;
    height: calc(100vh - 70px);
}

.sidebar {
    width: 250px;
    background-color: #fff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow-y: auto;
}

.sidebar h3 {
    font-size: 0.9rem;
    margin: 15px 0 10px 0;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.tool-group {
    margin-bottom: 20px;
}

.tool-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 5px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: #e9ecef;
}

.tool-btn.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Icons Toolbar */
.icon-toolbar {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tool-btn-icon, .action-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    color: #555;
    transition: all 0.2s;
    position: relative; /* For tooltip */
}

.tool-btn-icon:hover, .action-icon:hover {
    background-color: #e9ecef;
    color: var(--secondary-color);
}

.tool-btn-icon.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* CSS Tooltips */
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 5px;
    pointer-events: none;
}

.canvas-container {
    flex-grow: 1;
    background-color: #e0e0e0;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
}

canvas {
    display: block;
    background-color: white;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}

.shortcuts-list ul {
    list-style-type: none;
    margin-bottom: 15px;
}

.shortcuts-list li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.shortcuts-list code {
    background: #eee;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-weight: bold;
}
