body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

h1, h2 {
    text-align: center;
    color: #2c3e50;
}

h1 {
    margin-top: 0;
}

.controls {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #34495e;
}

input[type="file"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

textarea {
    resize: vertical;
}

.word-counter {
    text-align: right;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
}

.adjustments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.alignment-controls {
    margin-bottom: 20px;
}

.button-group {
    display: flex;
    gap: 10px;
}

.control-button {
    background-color: #ecf0f1;
    color: #34495e;
    border: 1px solid #bdc3c7;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    flex-grow: 1;
    transition: background-color 0.2s, border-color 0.2s;
}

.control-button.active,
.control-button:hover {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

#italicBtn {
    max-width: 50px;
    font-style: italic;
    font-family: "Georgia", serif;
    font-size: 18px;
    padding: 8px;
}

button#generateBtn {
    width: 100%;
    padding: 12px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 18px;
    text-decoration: none;
    transition: background-color 0.3s;
    margin-top: 10px;
}

button#generateBtn:hover {
    background-color: #229954;
}

.output {
    text-align: center;
}

canvas {
    max-width: 100%;
    border: 1px dashed #ccc;
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #fdfdfd;
}

.output-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.button {
    display: block;
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    font-size: 16px;
    text-decoration: none;
    transition: background-color 0.3s;
}

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

.button.secondary {
    background-color: #e74c3c;
}

.button.secondary:hover {
    background-color: #c0392b;
}

.effects-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.effect-group {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    background-color: #fcfcfc;
}

.effect-group label {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #2c3e50;
}

.effect-group .input-group {
    margin-bottom: 10px;
}

.effect-group .control-button {
    width: 100%;
    margin-bottom: 15px;
    background-color: #f1c40f; /* Yellow for toggle buttons */
    color: #fff;
    border-color: #f39c12;
}

.effect-group .control-button.active {
    background-color: #2ecc71; /* Green when active */
    border-color: #27ae60;
}

/* Styles for Custom Font Upload */
.drop-zone {
    border: 2px dashed #cccccc;
    border-radius: 5px;
    padding: 20px;
    text-align: center;
    color: #666666;
    margin-top: 10px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.drop-zone.hover {
    background-color: #f0f0f0;
}

.input-group input[type="checkbox"] {
    width: auto; /* Override 100% width for other inputs */
    margin-right: 10px;
}

.input-group label[for="useCustomFont"] {
    display: inline-block;
    cursor: pointer;
}