/* ===== CROSSWORD CREATOR PAGE STYLES ===== */

/* Page Layout */
.creator-section {
    padding: 40px 0 80px;
    background-color: var(--bg-light);
}

.page-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.4rem;
}

.creator-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

/* Controls Panel */
.controls-panel {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    align-self: flex-start;
}

.panel-section {
    margin-bottom: 30px;
}

.panel-section:last-child {
    margin-bottom: 0;
}

.panel-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.panel-section h4 {
    font-size: 1.1rem;
    margin: 20px 0 10px;
    color: var(--text-color);
}

.theme-selector, .grid-size-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.theme-btn, .size-btn {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 15px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.theme-btn:hover, .size-btn:hover {
    background: var(--bg-dark);
}

.theme-btn.active, .size-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.custom-theme {
    margin-top: 20px;
}

.note {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 5px;
}

.difficulty-slider {
    width: 100%;
    padding: 0 5px;
}

.difficulty-slider input {
    width: 100%;
    margin-bottom: 10px;
}

.difficulty-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
}

#generate-btn {
    width: 100%;
    margin-bottom: 10px;
    font-size: 1.1rem;
    padding: 15px;
}

.token-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.token-info i {
    margin-right: 5px;
}

/* Preview Panel */
.preview-panel {
    flex: 2;
    min-width: 500px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 12px 25px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    flex: 1;
    min-height: 400px;
}

.tab-pane {
    display: none;
    height: 100%;
}

.tab-pane.active {
    display: block;
}

/* Crossword Grid */
.crossword-grid {
    height: 100%;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.placeholder-message {
    text-align: center;
    color: var(--text-xlight);
}

.placeholder-message i {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.placeholder-message .small {
    font-size: 0.9rem;
    margin-top: 5px;
}

.loading {
    text-align: center;
    color: var(--text-light);
}

.loading i {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.grid {
    display: grid;
    gap: 1px;
    background-color: #333;
    padding: 1px;
    border: 2px solid #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.cell {
    background-color: white;
    aspect-ratio: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.black-cell {
    background-color: #333;
}

.cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #333;
}

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

.cell-input {
    width: 80%;
    height: 80%;
    border: none;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    background: none;
}

.cell-input:focus {
    outline: 2px solid var(--primary-color);
    border-radius: 2px;
}

/* Clues Tab */
.clues-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    height: 100%;
    overflow-y: auto;
}

.across-clues, .down-clues {
    flex: 1;
    min-width: 250px;
}

.across-clues h3, .down-clues h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-color);
}

.across-clues ul, .down-clues ul {
    list-style: none;
}

.across-clues li, .down-clues li {
    margin-bottom: 10px;
    line-height: 1.4;
}

.clue-number {
    font-weight: bold;
    margin-right: 5px;
}

.placeholder-clue {
    color: var(--text-xlight);
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
}

.action-buttons .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-buttons .btn i {
    font-size: 0.9rem;
}

.action-buttons .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Print Styling */
@media print {
    header, footer, .controls-panel, .tabs, .action-buttons {
        display: none !important;
    }
    
    .creator-section {
        padding: 0;
        background: none;
    }
    
    .page-title {
        margin: 20px 0;
    }
    
    .creator-container, .preview-panel {
        box-shadow: none;
        padding: 0;
    }
    
    .tab-pane {
        display: block !important;
    }
    
    #solution-tab {
        page-break-before: always;
    }
}

/* Responsive Styling */
@media (max-width: 992px) {
    .creator-container {
        flex-direction: column;
    }
    
    .controls-panel, .preview-panel {
        width: 100%;
    }
    
    .preview-panel {
        min-width: unset;
    }
}

@media (max-width: 768px) {
    .clues-container {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .action-buttons .btn {
        flex: 1;
        min-width: 150px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        padding: 10px;
        font-size: 1rem;
    }
}
/* Custom Theme Form Styles */
.custom-theme-form {
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-top: 10px;
}

.custom-theme-form .form-group {
    margin-bottom: 12px;
}

.custom-theme-form input,
.custom-theme-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.custom-theme-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-light);
}

#generate-theme-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-color);
}

.modal-content h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.modal-content h4 {
    margin: 15px 0;
}

/* Word List Container */
.word-list-container {
    max-height: 300px;
    overflow-y: auto;
    margin: 15px 0;
    padding: 10px;
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
}

#generated-words-list {
    list-style: none;
}

#generated-words-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#generated-words-list li:last-child {
    border-bottom: none;
}

#use-theme-btn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
}

/* Theme Status Loading */
#theme-status.loading {
    text-align: center;
    padding: 30px 0;
}

#theme-status.loading i {
    color: var(--primary-color);
    margin-bottom: 15px;
}

#theme-status.loading p {
    margin: 5px 0;
}

#theme-status.loading p.small {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Login Prompt */
.login-prompt {
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-prompt p {
    margin-bottom: 10px;
}

.login-prompt a {
    font-weight: 600;
}

/* Additional responsive styles */
@media (max-width: 576px) {
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .custom-theme-form {
        padding: 10px;
    }
}
