/* Create Page Specific Styles */

.create-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Top Navigation */
.top-nav {
    background: white;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-tabs {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 0;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1rem 2rem;
    text-decoration: none;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1.1rem;
    background: #f8f9fa;
    flex: 1;
    justify-content: center;
}

.nav-tab:hover {
    color: #333;
    background: #e9ecef;
}

.nav-tab.active {
    color: #5d4e75;
    background: white;
    border-bottom-color: #5d4e75;
}

/* Groups Section */
.groups-section {
    margin-bottom: 2rem;
}

.group-creator {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
}

.group-creator:hover {
    border-color: #5d4e75;
}

.group-creator.valid {
    border-color: #28a745;
    background: #f8fff9;
}

.group-creator.invalid {
    border-color: #dc3545;
    background: #fff8f8;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.group-header label {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.difficulty-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    min-width: 150px;
}

.category-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.category-input:focus {
    outline: none;
    border-color: #5d4e75;
}

.words-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.word-input {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-transform: uppercase;
    transition: border-color 0.3s ease;
}

.word-input:focus {
    outline: none;
    border-color: #5d4e75;
}

.word-input.duplicate {
    border-color: #dc3545;
    background: #fff5f5;
}

/* Preview Section */
.preview-section {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    min-height: 200px;
}

.preview-word {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
    height: 80px;
    min-height: 80px;
    max-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    word-break: keep-all;
    hyphens: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-word.difficulty-easy { background: #fff3cd; border-color: #ffeaa7; }
.preview-word.difficulty-medium { background: #d4edda; border-color: #98fb98; }
.preview-word.difficulty-hard { background: #cce5ff; border-color: #74b9ff; }

.validation-message {
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    margin-top: 1rem;
}

.validation-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.validation-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.validation-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Actions Section */
.actions-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 140px;
    flex: 1;
    max-width: 200px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Instructions */
.instructions {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.instructions h3 {
    color: #5d4e75;
    margin-bottom: 1rem;
}

.instructions ul {
    margin: 0;
    padding-left: 1.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h2 {
    margin: 0;
    color: #5d4e75;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

/* Share Modal Specific */
.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.share-link {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
}

.share-note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 1rem;
}

/* Test Game Container */
#testGame {
    min-height: 400px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-tabs {
        flex-direction: row;
    }
    
    .nav-tab {
        text-align: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .create-container {
        padding: 10px;
    }
    
    .group-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .words-container {
        grid-template-columns: 1fr;
    }
    
    .preview-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .preview-word {
        height: 60px;
        min-height: 60px;
        max-height: 60px;
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .actions-section {
        flex-direction: row;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .btn {
        flex: 1;
        min-width: auto;
        max-width: none;
        font-size: 0.9rem;
        padding: 0.65rem 1rem;
    }
    
    .share-link-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .preview-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }
    
    .preview-word {
        height: 50px;
        min-height: 50px;
        max-height: 50px;
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .actions-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn {
        flex: none;
        width: 100%;
    }
}

/* Submission Modal Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5d4e75;
}

.submission-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #856404;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

@media (max-width: 480px) {
    .modal-actions {
        flex-direction: column;
    }
}
