/**
 * SnapSite Municipal Generator - Frontend Styles
 */

/* Container */
.ssmg-generator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Progress Bar */
.ssmg-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.ssmg-progress-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 4px;
    background: #e0e0e0;
    z-index: 0;
}

.ssmg-progress-fill {
    position: absolute;
    top: 20px;
    left: 0;
    height: 4px;
    background: #1e3a5f;
    transition: width 0.3s ease;
    z-index: 1;
}

.ssmg-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.ssmg-progress-step .step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.ssmg-progress-step.active .step-number {
    background: #1e3a5f;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.2);
}

.ssmg-progress-step.completed .step-number {
    background: #4caf50;
    color: #fff;
}

.ssmg-progress-step .step-label {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    text-align: center;
    max-width: 80px;
}

.ssmg-progress-step.active .step-label {
    color: #1e3a5f;
    font-weight: 600;
}

/* Steps */
.ssmg-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.ssmg-step.active {
    display: block;
}

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

.ssmg-step h2 {
    font-size: 28px;
    color: #1e3a5f;
    margin-bottom: 8px;
}

.ssmg-step-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Form Fields */
.ssmg-form-row {
    margin-bottom: 24px;
}

.ssmg-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.ssmg-form-row input[type="text"],
.ssmg-form-row input[type="email"],
.ssmg-form-row input[type="tel"],
.ssmg-form-row input[type="number"],
.ssmg-form-row select,
.ssmg-form-row textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ssmg-form-row input:focus,
.ssmg-form-row select:focus,
.ssmg-form-row textarea:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.ssmg-form-row .field-hint {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
}

.ssmg-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .ssmg-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Departments List */
#ssmg-departments-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ssmg-dept-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s ease;
}

.ssmg-dept-item:hover {
    border-color: #1e3a5f;
}

.ssmg-dept-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.ssmg-dept-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #1e3a5f;
}

.ssmg-dept-name {
    font-weight: 600;
    color: #333;
}

.ssmg-dept-services {
    font-size: 13px;
    color: #666;
    margin: 8px 0;
    padding-left: 30px;
}

.ssmg-dept-phone {
    width: 100%;
    padding: 8px 12px !important;
    font-size: 14px !important;
    margin-top: 8px;
}

.ssmg-custom-badge {
    font-size: 11px;
    background: #c9a227;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.ssmg-add-dept-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
}

.ssmg-add-dept-row input {
    flex: 1;
    padding: 12px 16px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    font-size: 15px;
}

.ssmg-add-dept-btn {
    padding: 12px 24px;
    background: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ssmg-add-dept-btn:hover {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

/* Officials List */
#ssmg-officials-list {
    margin-bottom: 20px;
}

.ssmg-official-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 12px;
}

.ssmg-official-fields {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ssmg-official-fields input,
.ssmg-official-fields select {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.ssmg-remove-official {
    width: 36px;
    height: 36px;
    border: none;
    background: #ff4444;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s ease;
}

.ssmg-remove-official:hover {
    background: #cc0000;
}

.ssmg-add-official-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ssmg-add-official-btn:hover {
    background: #1e3a5f;
    color: #fff;
    border-style: solid;
    border-color: #1e3a5f;
}

/* Features Grid */
.ssmg-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.ssmg-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
}

.ssmg-feature-toggle {
    width: 48px;
    height: 26px;
    appearance: none;
    background: #ccc;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.ssmg-feature-toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
}

.ssmg-feature-toggle:checked {
    background: #4caf50;
}

.ssmg-feature-toggle:checked::after {
    transform: translateX(22px);
}

.ssmg-feature-label {
    font-weight: 600;
    color: #333;
}

/* Colors */
.ssmg-colors-section {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.ssmg-color-picker {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ssmg-color-picker input[type="color"] {
    width: 60px;
    height: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
}

.ssmg-color-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
}

.ssmg-color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 8px;
}

/* Logo Upload */
.ssmg-logo-upload {
    margin-bottom: 30px;
}

#ssmg-logo-preview {
    width: 200px;
    height: 100px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

#ssmg-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ssmg-upload-logo-btn {
    padding: 10px 20px;
    background: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* Review Summary */
#ssmg-review-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

.ssmg-summary-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.ssmg-summary-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.ssmg-summary-section h4 {
    font-size: 14px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.ssmg-summary-section ul {
    margin: 0;
    padding-left: 20px;
}

.ssmg-summary-section li {
    margin-bottom: 6px;
}

.ssmg-color-preview-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

/* Navigation Buttons */
.ssmg-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.ssmg-btn {
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.ssmg-btn-primary,
.ssmg-generate-btn {
    background: #1e3a5f;
    color: #fff;
    border: none;
}

.ssmg-btn-primary:hover,
.ssmg-generate-btn:hover {
    background: #2c4f7c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

.ssmg-btn-secondary,
.ssmg-prev-btn {
    background: #fff;
    color: #333;
    border: 2px solid #ccc;
}

.ssmg-btn-secondary:hover,
.ssmg-prev-btn:hover {
    border-color: #1e3a5f;
    color: #1e3a5f;
}

.ssmg-next-btn {
    background: #1e3a5f;
    color: #fff;
    border: none;
}

.ssmg-next-btn:hover {
    background: #2c4f7c;
}

/* Loading Overlay */
.ssmg-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.ssmg-loading-content {
    background: #fff;
    padding: 48px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
}

.ssmg-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e0e0e0;
    border-top-color: #1e3a5f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.ssmg-loading-message {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
}

.ssmg-loading-steps {
    text-align: left;
}

.ssmg-loading-step {
    padding: 10px 16px;
    margin-bottom: 8px;
    border-radius: 6px;
    color: #888;
    font-size: 14px;
}

.ssmg-loading-step.active {
    background: #e3f2fd;
    color: #1e3a5f;
    font-weight: 600;
}

.ssmg-loading-step.completed {
    color: #4caf50;
}

.ssmg-loading-step.completed::before {
    content: '✓ ';
}

/* Success Screen */
.ssmg-success {
    text-align: center;
    padding: 40px;
}

.ssmg-success-icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    color: #fff;
    border-radius: 50%;
    font-size: 48px;
    line-height: 80px;
    margin: 0 auto 24px;
}

.ssmg-success h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 12px;
}

.ssmg-success p {
    font-size: 18px;
    color: #666;
    margin-bottom: 32px;
}

.ssmg-success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 40px;
}

.ssmg-success-tips {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.ssmg-success-tips h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #333;
}

.ssmg-success-tips li {
    margin-bottom: 8px;
    color: #555;
}

/* Error Message */
.ssmg-error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.ssmg-error-icon {
    width: 24px;
    height: 24px;
    background: #c62828;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    flex-shrink: 0;
}

.ssmg-error-text {
    flex: 1;
}

.ssmg-error-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #c62828;
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .ssmg-generator-container {
        padding: 20px 16px;
    }

    .ssmg-progress-step .step-label {
        display: none;
    }

    .ssmg-step h2 {
        font-size: 24px;
    }

    .ssmg-colors-section {
        flex-direction: column;
        gap: 20px;
    }

    .ssmg-official-fields {
        grid-template-columns: 1fr;
    }

    .ssmg-nav-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .ssmg-nav-buttons .ssmg-btn {
        width: 100%;
        text-align: center;
    }

    .ssmg-success-actions {
        flex-direction: column;
    }
}
