body {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: #333;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
    box-sizing: border-box;
}

.controls {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.mobile-menu-button {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 24px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 999;
}

.mobile-menu-button span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 3px;
    transition: transform 0.3s ease;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.text-management {
    display: flex;
    gap: 10px;
}

.text-management button {
    flex: 1;
    padding: 8px;
}

#addText {
    background-color: #28a745;
}

#addText:hover {
    background-color: #218838;
}

#removeText {
    background-color: #dc3545;
}

#removeText:hover {
    background-color: #c82333;
}

.emoji-picker {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.emoji-picker h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.emoji-list {
    height: 150px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 5px;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.emoji-list span {
    font-family: 'Noto Emoji', sans-serif;
    font-size: 24px;
    cursor: pointer;
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    user-select: none;
}

.emoji-list span:hover {
    background-color: #f0f0f0;
}

#textInput {
    width: 100%;
    height: 100px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

.text-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
}

.text-controls label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

.text-controls input[type="range"] {
    flex: 1;
    accent-color: #007bff;
}

.text-alignment {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.text-alignment label {
    font-size: 14px;
    color: #333;
}

.text-alignment-buttons {
    display: flex;
    gap: 5px;
}

.text-alignment-buttons button {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
    transition: all 0.2s;
}

.text-alignment-buttons button.active {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

.alignment-controls {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.alignment-controls button {
    flex: 1;
    white-space: nowrap;
}

button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#exportPdf {
    background-color: #28a745;
    width: 100%;
    margin-top: 10px;
}

#exportPdf:hover {
    background-color: #218838;
}

.canvas-container {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 384px;
    margin: 0 auto;
}

#labelCanvas {
    border: 1px solid #ddd;
    background-color: white;
    width: 100% !important;
    height: auto !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    body {
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }

    .container {
        padding: 0;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    .mobile-menu-button {
        display: flex;
    }

    .controls {
        position: fixed;
        right: -320px;
        top: 0;
        bottom: 0;
        width: 300px;
        margin: 0;
        border-radius: 0;
        transition: transform 0.3s ease;
        overflow-y: auto;
        height: 100vh;
        transform: translateX(0);
        visibility: hidden;
    }

    .controls.active {
        transform: translateX(-320px);
        visibility: visible;
    }

    .overlay.active {
        display: block;
    }

    .mobile-menu-button.active span:nth-child(1) {
        transform: translateY(10px) rotate(45deg);
    }

    .mobile-menu-button.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-button.active span:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg);
    }

    .canvas-container {
        margin-top: 60px;
        padding: 0;
        height: calc(100vh - 60px);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .canvas-wrapper {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #labelCanvas {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
    }
}