/* Crossword specific styles */
.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
    margin: 2rem 0;
}

.generate-btn {
    background: rgba(255, 215, 0, 0.85);
    color: var(--text-color);
    border: none;
    padding: 1.2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 48%;
    margin: 0.5rem;
    display: inline-flex;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

#generate-random-btn {
    background: rgba(255, 215, 0, 0.3);
}

#generate-random-btn:hover {
    opacity: 1;
}

.word-clue-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    height: 400px;
    overflow-y: auto;
    padding-right: 1rem;
    padding-left: 0.5rem;
    counter-reset: word-number;
}

.word-clue-pair {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 1.5rem;
    padding-right: 0;
}

.word-clue-pair::before {
    content: counter(word-number);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-150%);
    font-weight: 500;
    color: #666;
    min-width: 1rem;
    text-align: left;
}

.word-input-field,
.clue-input-field {
    padding: 0.8rem 2.5rem 0.8rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    width: 100%;
}

.word-input-field {
    font-weight: 500;
}

.clue-input-field {
    margin-left: 0;
}

.word-input-field:focus,
.clue-input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

.remove-pair {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease;
    position: absolute;
    right: 0.5rem;
    top: 0.4rem;
}

.remove-pair:hover {
    color: #ff0000;
    background-color: rgba(255, 68, 68, 0.1);
}

.word-input-buttons {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.add-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.add-btn:hover {
    background-color: var(--primary-color-dark);
}

#add-word-btn {
    background: rgba(255, 215, 0, 0.3);
    color: #000;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-right: 2rem;
    margin-bottom: 1rem;
}

#add-word-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.clear-btn {
    background: rgba(255, 68, 68, 0.7);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #ff2525;
}


/* Puzzle Grid Styles */
.crossword-table {
    border-collapse: collapse;
    margin: 2rem auto;
    background: white;
}

.crossword-table td {
    border: 1px solid #000;
    position: relative;
    padding: 0;
}

/* Small size (10x10) */
.crossword-table td {
    width: 2.2rem;
    height: 2.2rem;
}

/* Small size (10x10) */
input[value="small"]:checked ~ .generator-content .crossword-table td {
    width: 3rem;
    height: 3rem;
}

/* Medium size (15x15) */
input[value="medium"]:checked ~ .generator-content .crossword-table td {
    width: 2.2rem;
    height: 2.2rem;
}

/* Large size (20x20) */
input[value="large"]:checked ~ .generator-content .crossword-table td {
    width: 1.6rem;
    height: 1.6rem;
}

.crossword-cell {
    background: white;
    text-align: center;
}

.cell-blocked {
    visibility: hidden;
    border: none !important;
}

.cell-number {
    position: absolute;
    top: 0.1rem;
    left: 0.1rem;
    color: #000;
}

/* Cell number sizes for different grid sizes */
input[value="small"]:checked ~ .generator-content .cell-number {
    font-size: 1rem;
}

input[value="medium"]:checked ~ .generator-content .cell-number {
    font-size: 0.8rem;
}

input[value="large"]:checked ~ .generator-content .cell-number {
    font-size: 0.65rem;
}

.cell-letter {
    font-weight: bold;
    text-transform: uppercase;
}

/* Letter sizes for different grid sizes */
input[value="small"]:checked ~ .generator-content .cell-letter {
    font-size: 1.5rem;
}

input[value="medium"]:checked ~ .generator-content .cell-letter {
    font-size: 1.2rem;
}

input[value="large"]:checked ~ .generator-content .cell-letter {
    font-size: 0.9rem;
}

/* Clue Lists */
.clue-lists {
    display: flex;
    gap: 2rem;
    margin: 2rem auto;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 900px;
    padding: 0 1rem;
}

.clue-list {
    flex: 1;
    max-width: 400px;
}

.clue-list h3 {
    margin-bottom: 1rem;
    text-align: center;
}

.clue-list ol {
    list-style-position: inside;
    padding-left: 0;
}

.clue-list li {
    margin-bottom: 0.5rem;
}

/* Size Options */


/* Answer Sheet Styles */
.page-break {
    page-break-before: always;
    margin-top: 3rem;
}

.answer-sheet {
    margin-top: 3rem;
}

.answer-sheet-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    /* Hide elements that should not be printed */
    body * {
        visibility: hidden;
    }
    
    .navbar,
    .utility-nav,
    .main-header,
    .top-menu,
    .generator-container > h1,
    .input-section,
    .preview-header,
    .description-section,
    .action-buttons,
    .print-btn,
    .preview-actions,
    footer {
        display: none !important;
    }

    /* Reset styles for the print containers */
    body,
    .generator-container,
    .generator-content,
    .preview-section,
    .preview-wrapper {
        background: white !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        display: block !important;
        overflow: visible !important;
    }

    #puzzle-preview,
    #puzzle-preview * {
        visibility: visible;
    }
    
    #puzzle-preview {
        transform: none !important;
        width: 210mm !important;
        height: 297mm !important;
        padding: 20mm !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        box-sizing: border-box !important;
        position: relative !important;
        background: white !important;
        display: block !important;
    }

    .crossword-grid {
        page-break-inside: avoid;
    }

    .clue-lists {
        position: relative;
        margin: 2rem auto;
        page-break-inside: avoid;
    }
    
    .answer-btn {
        display: none !important;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .clue-lists {
        flex-direction: column;
        gap: 1rem;
        margin: 1rem auto;
    }
    
    .clue-list {
        max-width: 100%;
    }

    .word-clue-pair {
        flex-direction: column;
        align-items: stretch;
    }

    .word-input-field,
    .clue-input-field {
        width: 100%;
    }

    .remove-pair {
        align-self: flex-end;
    }
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.print-button {
    background-color: #FFD600;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.answer-button {
    background-color: #FFE5E5;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #000;
}

.print-button i,
.answer-button i {
    font-size: 1rem;
}

.print-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.print-controls button {
    padding: 0.3rem 0.8rem;
    background: #fff;
    border: 1px solid #000;
    border-radius: 3px;
    cursor: pointer;
}

.print-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.print-controls input[type="checkbox"] {
    margin: 0;
}

.worksheet-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.worksheet-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    cursor: pointer;
}

.worksheet-button.print {
    background-color: #FFD600;
}

.worksheet-button.answers {
    background-color: #FFE5E5;
}

.word-input {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    counter-reset: word-number;
}

.word-input h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 500;
}

.word-clue-container {
    counter-reset: word-number;
}

.word-clue-pair {
    counter-increment: word-number;
}

.word-clue-container::-webkit-scrollbar {
    width: 6px;
}

.word-clue-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.word-clue-container::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.word-clue-container::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
}

.reset-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.3rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    color: #4a90d9;
    transform: scale(1.2);
}

#puzzle-preview {
    position: relative;
    padding-bottom: 20px;
}

#puzzle-preview .crossword-grid {
    margin-bottom: 80px;
}

#puzzle-preview .clue-lists {
    position: relative;
    display: flex;
    gap: 4rem;
    margin: 0 auto;
    justify-content: center;
    padding: 20px;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

#puzzle-preview .across-clues,
#puzzle-preview .down-clues {
    flex: 1;
    width: 50%;
    max-width: 350px;
    padding: 0 20px;
    box-sizing: border-box;
}

#puzzle-preview .clue-list-title {
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1em;
}

#puzzle-preview .clue-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#puzzle-preview .clue-item {
    margin-bottom: 5px;
    text-align: left;
    padding-right: 15px;
}

#puzzle-preview .clue-number {
    margin-right: 8px;
    display: inline-block;
}

#puzzle-preview .clue-text {
    display: inline-block;
}

/* Print styles for clue lists */
@media print {
    #puzzle-preview {
        padding-bottom: 20px;
    }
    
    #puzzle-preview .clue-lists {
        position: relative;
        page-break-inside: avoid;
    }
} 