/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e3c72;
    --secondary-color: #2a5298;
    --accent-color: #f093fb;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 2.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.app-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

/* Form */
.app-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.label-icon {
    font-size: 1.2rem;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Upload Container */
.upload-container {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.icon-preview {
    width: 100px;
    height: 100px;
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

.icon-preview.has-image {
    border-style: solid;
    border-color: var(--primary-color);
}

.preview-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.preview-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 5px;
}

.preview-text {
    font-size: 0.85rem;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-btn {
    flex: 1;
    min-width: 150px;
    padding: 14px 20px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.upload-btn:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.upload-icon {
    font-size: 2rem;
}

.upload-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.upload-input {
    display: none;
}

/* Platform Selector */
.platform-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.platform-option {
    flex: 1;
    min-width: 100px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.platform-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.platform-option input[type="checkbox"] {
    display: none;
}

.platform-option input[type="checkbox"]:checked + .platform-icon {
    transform: scale(1.1);
}

.platform-icon {
    font-size: 2rem;
    transition: transform 0.3s ease;
}

.platform-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.platform-option input[type="checkbox"]:checked ~ .platform-name {
    color: var(--primary-color);
}

/* Advanced Options */
.advanced-options {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.advanced-summary {
    padding: 15px 20px;
    background: var(--bg-secondary);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    transition: background 0.3s ease;
}

.advanced-summary:hover {
    background: rgba(102, 126, 234, 0.1);
}

.advanced-summary::-webkit-details-marker {
    display: none;
}

.advanced-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--bg-primary);
}

.color-input {
    height: 50px;
    padding: 5px;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.checkbox-label:hover {
    background: var(--bg-secondary);
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-weight: bold;
}

.checkbox-text {
    font-weight: 500;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.5rem;
}

/* Progress Section */
.progress-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.progress-card {
    text-align: center;
    padding: 40px;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.progress-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.progress-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.progress-text {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-step {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Result Section */
.result-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.result-card {
    text-align: center;
    padding: 40px;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.result-icon.success {
    animation: success 0.5s ease;
}

@keyframes success {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.result-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.result-text {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.download-btn {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.download-btn.android:hover {
    border-color: #3DDC84;
    background: rgba(61, 220, 132, 0.05);
}

.download-btn.ios:hover {
    border-color: #000;
    background: rgba(0, 0, 0, 0.05);
}

.download-btn.pwa:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.dl-icon {
    font-size: 1.5rem;
}

.install-guide {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: left;
}

.install-guide h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.step-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding-top: 4px;
}

.new-app-btn {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.new-app-btn:hover {
    background: var(--border-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: white;
    margin-top: 20px;
}

.footer p {
    margin: 5px 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body h3 {
    margin: 20px 0 10px;
    color: var(--text-primary);
}

.modal-body ul {
    list-style: none;
    padding: 0;
}

.modal-body li {
    padding: 8px 0;
    color: var(--text-secondary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 20px 15px;
    }

    .app-title {
        font-size: 2rem;
    }

    .main-content {
        padding: 20px;
    }

    .logo {
        font-size: 2rem;
    }

    .platform-selector {
        flex-direction: column;
    }

    .platform-option {
        width: 100%;
    }

    .upload-container {
        flex-direction: column;
    }

    .upload-btn {
        width: 100%;
    }
}

/* Print styles */
@media print {
    .header, .footer, .submit-btn {
        display: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937;
        --bg-secondary: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #9ca3af;
        --border-color: #4b5563;
    }

    body {
        background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    }

    .header, .main-content {
        background: rgba(31, 41, 55, 0.95);
    }
}