* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.app-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 992px) {
    .app-container {
        flex-direction: row;
    }
    
    .left-container {
        flex: 3;
    }
    
    .code-container {
        flex: 2;
    }
}

.left-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawing-container, 
.dimension-container,
.code-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tool-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tool-btn, .action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background-color: #e9ecef;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover, .action-btn:hover {
    background-color: #dee2e6;
}

.tool-btn.active {
    background-color: #4b6bfb;
    color: white;
}

.action-btn {
    background-color: #3498db;
    color: white;
}

.action-btn:hover {
    background-color: #2980b9;
}

.color-picker,
.thickness-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mini-btn {
    padding: 2px 5px;
    font-size: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #f8f9fa;
    cursor: pointer;
}

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

/* Line thickness control */
.thickness-control input[type="range"] {
    width: 80px;
    height: 7px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #e9ecef;
    outline: none;
    border-radius: 3px;
    cursor: pointer;
}

.thickness-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #3498db;
    border-radius: 50%;
    border: none;
}

.thickness-control input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #3498db;
    border-radius: 50%;
    border: none;
}

.thickness-control span {
    font-size: 0.85rem;
    min-width: 35px;
}

canvas {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: crosshair;
    display: block;
}

/* Resizable drawing canvas container */
.canvas-container {
    position: relative;
    width: 600px; /* Initial width */
    height: 400px; /* Initial height */
    overflow: hidden; /* Hide overflow */
    min-width: 300px; /* Minimum size */
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#drawing-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    background-color: #3498db;
    cursor: nwse-resize;
    z-index: 10;
    border-top-left-radius: 3px;
}

.dimension-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dimensions-input {
    display: flex;
    gap: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.preview-area {
    margin-top: 10px;
}

.preview-area h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

#preview-canvas {
    border: 1px solid #ddd;
    margin-top: 5px;
    /* Remove max-width to prevent automatic scaling */
}

h3, h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

textarea {
    width: 100%;
    height: 370px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

#copy-btn {
    margin-top: 10px;
}

.github-link {
    margin-top: 20px;
    text-align: center;
}

.github-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #24292e;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.github-link a:hover {
    background-color: rgba(27, 31, 35, 0.08);
}

.github-link svg {
    vertical-align: middle;
}
