/**
 * Municipal Workflow Styles
 * Styling for municipal button workflow system
 */

/* Main Container */
.geo-municipal-button-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

/* Municipal Button Styles */
.geo-municipal-button {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 124, 186, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.geo-municipal-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004666 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 124, 186, 0.3);
    color: white;
}

.geo-municipal-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 124, 186, 0.2);
}

.geo-municipal-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button Sizes */
.geo-municipal-button.small {
    padding: 8px 16px;
    font-size: 14px;
}

.geo-municipal-button.medium {
    padding: 12px 24px;
    font-size: 16px;
}

.geo-municipal-button.large {
    padding: 16px 32px;
    font-size: 18px;
}

/* Button Styles */
.geo-municipal-button.primary {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
}

.geo-municipal-button.secondary {
    background: linear-gradient(135deg, #46b450 0%, #2e7d32 100%);
}

.geo-municipal-button.warning {
    background: linear-gradient(135deg, #ffb900 0%, #e08900 100%);
}

/* Quick Workflow Access */
.quick-workflow-access {
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.quick-access-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.municipality-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.quick-actions {
    display: flex;
    gap: 8px;
}

.quick-report-btn {
    background: #46b450;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.quick-report-btn:hover {
    background: #2e7d32;
    color: white;
}

.new-workflow-btn {
    background: transparent;
    border: 1px solid #ccc;
    color: #666;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-workflow-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

/* Workflow Status */
.municipal-workflow-status {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-top: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.spinner.spinning {
    animation: spin 1s linear infinite;
}

.spinner.completed {
    border-top-color: #46b450;
    animation: none;
}

.spinner.completed::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #46b450;
    font-weight: bold;
    font-size: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

/* Error Display */
.error-icon {
    font-size: 20px;
    color: #d63638;
}

.error-content {
    flex: 1;
}

.error-message {
    display: block;
    color: #d63638;
    font-weight: 500;
    margin-bottom: 8px;
}

.error-actions {
    display: flex;
    gap: 8px;
}

.error-actions .button {
    padding: 6px 12px;
    font-size: 12px;
    height: auto;
    line-height: 1.4;
}

/* Manual Municipality Selection */
.manual-selection {
    width: 100%;
}

.manual-selection h4 {
    margin: 0 0 12px;
    color: #333;
    font-size: 16px;
}

.selection-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selection-form label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.municipality-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    width: 100%;
    max-width: 300px;
}

.municipality-select:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 1px #007cba;
}

.selection-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.selection-actions .button {
    padding: 8px 16px;
    font-size: 14px;
    height: auto;
    line-height: 1.4;
}

/* Workflow Result */
.municipal-workflow-result {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-top: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-content h4 {
    margin: 0 0 8px;
    color: #333;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-content h4::before {
    content: '🏛️';
    font-size: 16px;
}

.workflow-summary {
    color: #666;
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
}

.workflow-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.workflow-actions .button {
    padding: 10px 20px;
    font-size: 14px;
    height: auto;
    line-height: 1.4;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.continue-to-fluent {
    background: #46b450;
    color: white;
    border: none;
}

.continue-to-fluent:hover {
    background: #2e7d32;
    color: white;
}

.continue-to-fluent::before {
    content: '📝';
}

.view-group {
    background: transparent;
    color: #007cba;
    border: 1px solid #007cba;
}

.view-group:hover {
    background: #007cba;
    color: white;
}

.view-group::before {
    content: '👥';
}

/* RTL Support */
.rtl .geo-municipal-button-container {
    direction: rtl;
}

.rtl .status-indicator {
    flex-direction: row-reverse;
}

.rtl .quick-access-content {
    flex-direction: row-reverse;
}

.rtl .workflow-actions {
    flex-direction: row-reverse;
}

.rtl .selection-actions {
    flex-direction: row-reverse;
}

/* Responsive Design */
@media (max-width: 768px) {
    .geo-municipal-button {
        width: 100%;
        justify-content: center;
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .quick-access-content {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .quick-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .workflow-actions {
        flex-direction: column;
    }
    
    .workflow-actions .button {
        width: 100%;
        justify-content: center;
    }
    
    .selection-actions {
        flex-direction: column;
    }
    
    .selection-actions .button {
        width: 100%;
    }
    
    .municipality-select {
        max-width: none;
    }
}

/* Loading States */
.municipal-workflow-status.loading {
    opacity: 0.8;
}

.geo-municipal-button:disabled,
.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation Effects */
.municipal-workflow-status,
.municipal-workflow-result {
    animation: slideIn 0.3s ease;
}

.quick-workflow-access {
    animation: fadeIn 0.5s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Success States */
.workflow-success {
    background: #f0f8ff;
    border-color: #46b450;
}

.workflow-success .status-indicator::before {
    content: '✅';
    margin-right: 8px;
}

/* Integration with WordPress Admin */
.wp-admin .geo-municipal-button-container {
    font-family: inherit;
}

.wp-admin .geo-municipal-button {
    font-size: 13px;
}

.wp-admin .municipal-workflow-status,
.wp-admin .municipal-workflow-result {
    background: #fff;
}

/* Accessibility */
.geo-municipal-button:focus,
.municipality-select:focus,
.button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.spinner[aria-label] {
    position: relative;
}

.spinner[aria-label]::before {
    content: attr(aria-label);
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Print Styles */
@media print {
    .geo-municipal-button-container {
        background: white;
        border: 1px solid #000;
    }
    
    .geo-municipal-button,
    .workflow-actions,
    .quick-actions {
        display: none;
    }
    
    .municipal-workflow-result {
        border: 1px solid #000;
        background: white;
    }
}