/* Form styling and controls */

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.control-group select,
.control-group input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Week Navigation Buttons */
.week-nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.week-nav-btn {
    width: 28px;
    height: 20px;
    padding: 0;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    border-radius: 3px;
    transition: background 0.2s, border-color 0.2s;
}

.week-nav-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.week-nav-btn:active {
    background: #e0e0e0;
}

.btn-small {
    background: #2196F3;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #0b7dda;
}

.button-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}

/* Form rows and groups for modals */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Checkbox styling */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

.select-all-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.select-all-container label {
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    color: #333;
    font-size: 14px;
}

.select-all-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    transform: scale(1.1);
}

/* SQL Section Styling */
.sql-section {
    margin-top: 30px;
}

.sql-checkbox-container {
    margin-bottom: 15px;
}

.sql-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.sql-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sql-container {
    max-width: 10in;
    width: 100%;
}

.sql-output-with-button {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.sql-copy-btn {
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0;
}

.sql-output-with-button textarea {
    flex: 1;
    max-width: calc(10in - 120px); /* Account for button width and gap */
    min-height: 200px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #f8f9fa;
    resize: vertical;
}

/* Responsive form adjustments */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .button-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .sql-output-with-button {
        flex-direction: column;
        gap: 10px;
    }
    
    .sql-output-with-button textarea {
        max-width: 100%;
    }
    
    .sql-copy-btn {
        align-self: flex-start;
    }
}