* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.form-section, .preview-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.form-section h2, .preview-section h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.5rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.input-group small {
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

.generate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.generate-btn:hover {
    transform: translateY(-2px);
}

.phone-mockup {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

.phone-screen {
    width: 250px;
    height: 350px;
    background: #000;
    border-radius: 25px;
    padding: 20px;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
}

.phone-screen::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #333;
    border-radius: 2px;
}

.pwa-preview {
    background: white;
    height: 100%;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.preview-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 15px;
}

.pwa-preview h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #333;
}

.pwa-preview p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.install-button {
    background: #007AFF;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.status-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.status-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.download-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.download-section h2 {
    color: #22c55e;
    margin-bottom: 20px;
}

.download-section ul {
    text-align: left;
    max-width: 400px;
    margin: 20px auto;
}

.download-section li {
    margin-bottom: 8px;
    padding-left: 10px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.download-btn, .test-btn, .reset-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.download-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.test-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.reset-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.download-btn:hover, .test-btn:hover, .reset-btn:hover {
    transform: translateY(-2px);
}

/* Emulador */
.emulator-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-top: 40px;
    overflow: hidden;
}

.emulator-header {
    background: #f8fafc;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emulator-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.emulator-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.emulator-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.close-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
}

.emulator-container {
    padding: 40px;
    display: flex;
    justify-content: center;
    background: #f1f5f9;
}

.device-frame {
    position: relative;
    background: #1f2937;
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.device-frame.ios {
    border-radius: 40px;
    background: #000;
}

.device-screen {
    width: 375px;
    height: 667px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.device-frame.ios .device-screen {
    border-radius: 30px;
}

.device-screen::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    z-index: 10;
}

.device-frame.ios .device-screen::before {
    width: 120px;
    height: 6px;
    background: #000;
    border-radius: 3px;
}

#emulatorFrame {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-buttons button {
        width: 100%;
        max-width: 300px;
    }
    
    .device-screen {
        width: 300px;
        height: 533px;
    }
    
    .emulator-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}