/* =====================================================
   FreeWebToApk - PWA Builder Styles
   ===================================================== */

/* PWA Builder Page */
.pwa-builder-page {
    background: var(--bg-dark);
}

.pwa-builder-section {
    padding: 90px 0 40px;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.pwa-builder-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.pwa-builder-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.pwa-builder-header h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.pwa-builder-header .gradient-text {
    background: linear-gradient(135deg, #8B5CF6 0%, #00D4FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pwa-builder-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* PWA Stepper */
.pwa-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}

.pwa-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pwa-step-number {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.pwa-step.active .pwa-step-number {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
    border-color: #8B5CF6;
    color: white;
}

.pwa-step.completed .pwa-step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.pwa-step.completed .pwa-step-number::after {
    content: "✓";
}

.pwa-step-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.pwa-step.active .pwa-step-label {
    color: #8B5CF6;
    font-weight: 500;
}

.pwa-step-connector {
    flex: 1;
    max-width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 6px;
    margin-bottom: 20px;
}

.pwa-step-connector.completed {
    background: var(--success);
}

/* PWA Form Container */
.pwa-form-wrapper {
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.pwa-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    position: relative;
}

/* Step Content */
.pwa-step-content {
    display: none;
}

.pwa-step-content.active {
    display: block;
    animation: pwaFadeIn 0.3s ease;
}

@keyframes pwaFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pwa-step-header {
    margin-bottom: 20px;
}

.pwa-step-header h2 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.pwa-step-header p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Form Elements */
.pwa-form-group {
    margin-bottom: 16px;
}

.pwa-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.pwa-form-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.pwa-form-group select,
.pwa-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.pwa-form-group input:focus,
.pwa-form-group select:focus,
.pwa-form-group textarea:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.pwa-form-group input::placeholder {
    color: var(--text-muted);
}

.pwa-input-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.pwa-input-hint.success {
    color: var(--success);
}

.pwa-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Integration Cards */
.pwa-integration-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.pwa-integration-card.active {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.05);
}

.pwa-integration-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pwa-integration-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-integration-title span {
    font-size: 20px;
}

.pwa-integration-title h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.pwa-integration-toggle {
    position: relative;
    width: 52px;
    height: 28px;
}

.pwa-integration-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pwa-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: 0.3s;
    border-radius: 28px;
}

.pwa-toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    transition: 0.3s;
    border-radius: 50%;
}

.pwa-integration-toggle input:checked + .pwa-toggle-slider {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
    border-color: #8B5CF6;
}

.pwa-integration-toggle input:checked + .pwa-toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

.pwa-integration-body {
    display: none;
}

.pwa-integration-card.active .pwa-integration-body {
    display: block;
    animation: pwaFadeIn 0.3s ease;
}

/* Caching Strategy Options */
.pwa-caching-options {
    display: grid;
    gap: 12px;
}

.pwa-caching-option {
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-caching-option:hover {
    border-color: var(--border-light);
}

.pwa-caching-option.active {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.05);
}

.pwa-caching-option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.pwa-caching-option-header input[type="radio"] {
    accent-color: #8B5CF6;
    width: 18px;
    height: 18px;
}

.pwa-caching-option-header label {
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    margin: 0;
}

.pwa-caching-option p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    padding-left: 30px;
}

/* Upload Area */
.pwa-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-upload-area:hover,
.pwa-upload-area.dragover {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.05);
}

.pwa-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.pwa-upload-icon {
    font-size: 36px;
}

.pwa-upload-text {
    font-size: 13px;
}

.pwa-upload-text span {
    color: #8B5CF6;
    text-decoration: underline;
}

/* Icon Preview */
.pwa-icon-preview-container {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.pwa-icon-preview {
    width: 96px;
    height: 96px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pwa-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-icon-preview-placeholder {
    color: var(--text-muted);
    font-size: 36px;
}

/* Color Picker */
.pwa-color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-color-picker input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.pwa-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.pwa-color-picker input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.pwa-color-value {
    font-family: monospace;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Summary Card */
.pwa-summary-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.pwa-summary-card h3 {
    font-size: 15px;
    margin-bottom: 14px;
    color: #8B5CF6;
}

.pwa-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pwa-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pwa-summary-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pwa-summary-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

/* Signing Info */
.pwa-signing-info {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}

.pwa-signing-info h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--success);
}

.pwa-signing-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 3px 0;
}

/* Output Options */
.pwa-output-options {
    display: grid;
    gap: 10px;
}

.pwa-output-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.pwa-output-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8B5CF6;
}

.pwa-output-option label {
    flex: 1;
    cursor: pointer;
}

.pwa-output-option-title {
    font-weight: 500;
    font-size: 13px;
    margin: 0;
}

.pwa-output-option-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

/* Navigation */
.pwa-step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.pwa-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pwa-btn-primary {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
    color: white;
}

.pwa-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.pwa-btn-secondary {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.pwa-btn-secondary:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.pwa-btn-large {
    width: 100%;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 12px;
}

.pwa-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Generate Button */
.pwa-generate-section {
    text-align: center;
    margin-top: 20px;
}

.pwa-generate-section .pwa-btn-loading {
    display: none;
}

.pwa-generate-section .pwa-btn-loading.show {
    display: inline-flex;
}

.pwa-generate-section .pwa-btn-text.hidden {
    display: none;
}

.pwa-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: pwaSpin 0.8s linear infinite;
}

@keyframes pwaSpin {
    to { transform: rotate(360deg); }
}

/* Progress Modal */
.pwa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-modal.hidden {
    display: none;
}

.pwa-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.pwa-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
}

.pwa-modal-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.pwa-modal-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.pwa-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pwa-progress-bar-container {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.pwa-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Download Modal */
.pwa-download-modal .pwa-modal-content {
    max-width: 500px;
}

.pwa-download-buttons {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.pwa-download-note {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    padding: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: left;
}

/* Checkbox Style */
.pwa-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.pwa-checkbox-label:hover {
    border-color: var(--border-light);
}

.pwa-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #8B5CF6;
}

/* Help Link */
.pwa-help-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #8B5CF6;
    text-decoration: none;
    margin-top: 8px;
}

.pwa-help-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .pwa-builder-section {
        padding: 70px 12px 30px;
    }
    
    .pwa-builder-header {
        margin-bottom: 16px;
    }
    
    .pwa-builder-header h1 {
        font-size: 24px;
    }
    
    .pwa-builder-header p {
        font-size: 13px;
    }
    
    .pwa-stepper {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 12px 12px;
        margin-bottom: 20px;
    }
    
    .pwa-step-label {
        font-size: 10px;
    }
    
    .pwa-step-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .pwa-step-connector {
        max-width: 30px;
        margin-bottom: 16px;
    }
    
    .pwa-form-container {
        padding: 16px 14px;
        border-radius: 14px;
    }
    
    .pwa-step-header {
        margin-bottom: 16px;
    }
    
    .pwa-step-header h2 {
        font-size: 18px;
    }
    
    .pwa-step-header p {
        font-size: 12px;
    }
    
    .pwa-form-group {
        margin-bottom: 12px;
    }
    
    .pwa-form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .pwa-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .pwa-integration-card {
        padding: 14px;
        margin-bottom: 12px;
    }
    
    .pwa-caching-option {
        padding: 12px;
    }
    
    .pwa-upload-area {
        padding: 20px;
    }
    
    .pwa-step-navigation {
        flex-direction: column;
        gap: 10px;
        margin-top: 16px;
        padding-top: 14px;
    }
    
    .pwa-step-navigation .pwa-btn {
        width: 100%;
        justify-content: center;
    }
    
    .pwa-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .pwa-builder-section {
        padding: 65px 10px 24px;
    }
    
    .pwa-builder-header h1 {
        font-size: 22px;
    }
    
    .pwa-step-header h2 {
        font-size: 16px;
    }
    
    .pwa-form-container {
        padding: 14px 12px;
    }
    
    .pwa-integration-card {
        padding: 12px;
    }
    
    .pwa-icon-preview {
        width: 80px;
        height: 80px;
    }
}
