body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f8f9fa;
    color: #333;
}
.container {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}
.form-section {
    background-color: #f1f8ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}
.form-group {
    margin-bottom: 15px;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}
input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}
button {
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: background-color 0.3s;
}
button:hover {
    background-color: #2980b9;
}
.controls {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}
.controls button {
    flex: 1;
}
#crossword-output {
    display: none;
    margin-top: 30px;
}
.puzzle-header {
    text-align: center;
    margin-bottom: 20px;
}
.puzzle-header h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}
.grid-container {
    overflow-x: auto;
    margin: 20px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}
#crossword-table {
    border-collapse: collapse;
    margin: 0 auto;
    background-color: white;
}
.cell {
    width: 35px;
    height: 35px;
    border: 1px solid #333;
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    background-color: white;
    position: relative;
}
.cell.black {
    background-color: #000;
}
.cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 8px;
    font-weight: bold;
}
.clues-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 20px 0;
}
.clues-column {
    flex: 1;
    min-width: 300px;
}
.clues-column h3 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    margin-top: 0;
}
.clues-column ul {
    padding-left: 20px;
    margin: 0;
}
.clues-column li {
    margin-bottom: 8px;
    line-height: 1.4;
}
.solution-toggle {
    text-align: center;
    margin: 20px 0;
}
.solution-toggle button {
    background-color: #27ae60;
    margin: 0 auto;
}
.solution-toggle button:hover {
    background-color: #219653;
}
.solution-hidden {
    display: none;
}
.solution-visible {
    display: block;
}
.solution-content {
    background-color: #e8f4f8;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #3498db;
}
.solution-content h3 {
    margin-top: 0;
    color: #2c3e50;
}
.solution-content p {
    margin: 5px 0;
}
.solution-grid {
    margin-top: 20px;
    text-align: center;
}
.solution-grid table {
    margin: 0 auto;
    border-collapse: collapse;
}
.solution-grid td {
    width: 35px;
    height: 35px;
    border: 1px solid #333;
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    background-color: #fff;
}
.solution-grid .cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 8px;
    font-weight: bold;
}
.highlight-across {
    background-color: #d4edda !important;
    border: 2px solid #28a745 !important;
    box-sizing: border-box !important;
    font-weight: bold !important;
}
.highlight-down {
    background-color: #cce5ff !important;
    border: 2px solid #007bff !important;
    box-sizing: border-box !important;
    font-weight: bold !important;
}
.highlight-first-across {
    border: 4px solid #28a745 !important;
}
.highlight-first-down {
    border: 4px solid #007bff !important;
}
.status-message {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.checkbox-group input {
    width: auto;
}
.hidden-cell {
    border: none !important;
    background-color: transparent !important;
}
.hidden-letters .cell:not(.highlight-across):not(.highlight-down) {
    color: transparent !important;
}
@media print {
    body {
        background-color: white;
    }
    .container {
        box-shadow: none;
        padding: 0;
    }
    .form-section, .controls {
        display: none;
    }
    #crossword-output {
        display: block !important;
    }
    .solution-toggle {
        display: none;
    }
}