/*
 * =================================================================
 * File: auto-populate-modal.css
 * Purpose: Styles for the village auto-populate modal component
 * Spec Reference: tickets/active/TK-VB4-016-AUTO-POPULATION-API-UI.md
 *
 * Quality Verification:
 *   Test:   Not Started
 *   Review: Not Started
 *   Spec:   Not Started
 * =================================================================
 */

/* Modal Container */
#auto-populate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
}

/* Modal Overlay */
#auto-populate-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

/* Modal Container */
#auto-populate-modal .modal-container {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    max-height: 90vh;
    margin: 5vh auto;
    overflow-y: auto;
    z-index: 1051;
}

/* Modal Header */
#auto-populate-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px 8px 0 0;
}

#auto-populate-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
}

#auto-populate-modal .close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    line-height: 1;
    transition: color 0.2s;
}

#auto-populate-modal .close-btn:hover {
    color: #1f2937;
}

/* Modal Body */
#auto-populate-modal .modal-body {
    padding: 1.5rem;
}

/* Configuration Section */
#auto-populate-modal .config-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#auto-populate-modal .form-group {
    display: flex;
    flex-direction: column;
}

#auto-populate-modal .form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

#auto-populate-modal .form-control {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#auto-populate-modal .form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#auto-populate-modal .form-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

#auto-populate-modal .checkbox-group {
    flex-direction: row;
    align-items: center;
}

#auto-populate-modal .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
}

#auto-populate-modal .checkbox-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

/* Preview Section */
#auto-populate-modal .preview-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1.5rem;
}

#auto-populate-modal .preview-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

/* Preview Stats */
#auto-populate-modal .preview-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 4px;
}

#auto-populate-modal .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

#auto-populate-modal .stat-item:last-child {
    border-bottom: none;
}

#auto-populate-modal .stat-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
}

#auto-populate-modal .stat-value {
    font-weight: bold;
    color: #1f2937;
    font-size: 0.875rem;
}

/* Preview Buildings */
#auto-populate-modal .preview-buildings {
    max-height: 400px;
    overflow-y: auto;
}

#auto-populate-modal .buildings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Card styles now come from building-template-gallery.css (.template-card) */
/* Removed duplicate .building-preview-card styles - using shared .template-card */

/* Employee-specific styles (not in shared card CSS) */
#auto-populate-modal .building-employees {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

#auto-populate-modal .building-employees strong {
    color: #374151;
    display: block;
    margin-bottom: 0.25rem;
}

#auto-populate-modal .building-employees ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
    color: #6b7280;
}

#auto-populate-modal .building-employees li {
    margin-bottom: 0.25rem;
}

/* Progress Indicator */
#auto-populate-modal .progress-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 6px;
    margin-top: 1rem;
}

#auto-populate-modal .spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#auto-populate-modal .progress-indicator p {
    margin-top: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Error Message */
#auto-populate-modal .error-message {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Modal Footer */
#auto-populate-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 8px 8px;
}

/* Buttons */
#auto-populate-modal .btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

#auto-populate-modal .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#auto-populate-modal .btn-primary {
    background: #6366f1;
    color: white;
}

#auto-populate-modal .btn-primary:hover:not(:disabled) {
    background: #4f46e5;
}

#auto-populate-modal .btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

#auto-populate-modal .btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

#auto-populate-modal .btn-success {
    background: #10b981;
    color: white;
}

#auto-populate-modal .btn-success:hover:not(:disabled) {
    background: #059669;
}

/* Responsive Design */
@media (max-width: 768px) {
    #auto-populate-modal .modal-container {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    #auto-populate-modal .config-section {
        grid-template-columns: 1fr;
    }

    #auto-populate-modal .preview-stats {
        grid-template-columns: 1fr;
    }

    #auto-populate-modal .buildings-list {
        grid-template-columns: 1fr;
    }
}
