/* YallaApps - Clean Apple-style Design */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    background: #f4f1ea;
    min-height: 100vh;
    color: #1d1d1f;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 60px;
}

.logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: 2.5rem;
    color: #1d1d1f;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #1d1d1f;
    font-weight: 400;
}

/* Main Builder Section */
main {
    margin-bottom: 60px;
}

.builder-section {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-label {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.textarea-wrapper {
    flex: 1;
}

textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 140px;
    transition: border-color 0.2s;
    color: #1d1d1f;
}

textarea::placeholder {
    color: #86868b;
}

textarea:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

/* Options Panel */
.options-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 200px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #1d1d1f;
}

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

.checkmark {
    width: 20px;
    height: 20px;
    border: 1.5px solid #86868b;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-item input[type="checkbox"]:checked + .checkmark {
    background: #1d1d1f;
    border-color: #1d1d1f;
}

.checkbox-item input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.help-link {
    font-size: 0.85rem;
    color: #1d1d1f;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-left: 30px;
    transition: opacity 0.2s;
}

.help-link:hover {
    opacity: 0.6;
}

/* Create Button */
.button-wrapper {
    display: flex;
    justify-content: center;
}

.btn-create {
    background: #d4f5d4;
    color: #1d1d1f;
    border: 1px solid #b8e8b8;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 200px;
}

.btn-create:hover:not(:disabled) {
    background: #c4ecc4;
    border-color: #a8dca8;
}

.btn-create:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #1d1d1f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Build Status */
.build-status {
    margin-top: 30px;
}

.status-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge.queued {
    background: #f5f5f7;
    color: #86868b;
}

.badge.building, .badge.retrying {
    background: #e8f0fe;
    color: #1a73e8;
}

.badge.completed {
    background: #e6f4ea;
    color: #137333;
}

.badge.failed {
    background: #fce8e6;
    color: #c5221f;
}

#statusMessage {
    color: #1d1d1f;
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #f5f5f7;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: #1d1d1f;
    width: 0%;
    transition: width 0.5s ease;
}

.build-details {
    font-size: 0.9rem;
    color: #86868b;
}

.build-details div {
    margin-bottom: 4px;
}

/* Download Section */
.download-section {
    margin-top: 30px;
}

.success-card {
    background: #fff;
    border-radius: 12px;
    padding: 50px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    text-align: center;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #e6f4ea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: #137333;
}

.success-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.success-card p {
    color: #86868b;
    margin-bottom: 25px;
}

.btn-download {
    display: inline-block;
    background: #1d1d1f;
    color: #fff;
    text-decoration: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 15px;
}

.btn-download:hover {
    background: #000;
}

.btn-new {
    display: block;
    background: transparent;
    border: none;
    color: #0071e3;
    font-size: 1rem;
    cursor: pointer;
    margin: 0 auto;
    padding: 10px;
    transition: opacity 0.2s;
}

.btn-new:hover {
    opacity: 0.7;
}

/* Messages */
.messages-section {
    margin-top: 20px;
}

.messages {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    max-height: 200px;
    overflow-y: auto;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.message:last-child {
    margin-bottom: 0;
}

.message.user {
    background: #f5f5f7;
    color: #1d1d1f;
}

.message.system {
    background: #e8f0fe;
    color: #1a73e8;
}

.message.error {
    background: #fce8e6;
    color: #c5221f;
}

/* Error Section */
.error-section {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-top: 30px;
    text-align: center;
}

.error-message {
    margin-bottom: 30px;
}

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

.error-message h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.error-message p {
    color: #86868b;
    margin-bottom: 8px;
}

.feedback-form {
    max-width: 500px;
    margin: 0 auto;
}

.feedback-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 20px;
}

.feedback-form textarea:focus {
    outline: none;
    border-color: #0071e3;
}

.feedback-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.feedback-btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.feedback-btn.submit {
    background: #1d1d1f;
    color: #fff;
}

.feedback-btn.submit:hover {
    background: #000;
}

.feedback-btn.skip {
    background: #f5f5f7;
    color: #1d1d1f;
}

.feedback-btn.skip:hover {
    background: #e8e8ed;
}

.feedback-success {
    padding: 20px;
    background: #e6f4ea;
    border-radius: 8px;
    color: #137333;
}

/* FAQ Section */
footer {
    border-top: 1px solid #d2d2d7;
    padding-top: 40px;
}

.faq-section {
    max-width: 100%;
}

.faq-title {
    font-size: 1rem;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 20px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.faq-item {
    border-bottom: 1px solid #e8e8ed;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    color: #1d1d1f;
    text-align: left;
    font-family: inherit;
    transition: opacity 0.2s;
}

.faq-question:hover {
    opacity: 0.7;
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: #86868b;
    transition: transform 0.3s;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    padding: 0 0 20px 0;
    color: #86868b;
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    display: block;
}

.faq-answer ol, .faq-answer ul {
    margin-left: 20px;
}

.faq-answer li {
    margin-bottom: 8px;
}

.faq-answer p {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 40px 20px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .builder-section {
        padding: 25px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .options-panel {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .help-link {
        margin-left: 30px;
    }
    
    .btn-create {
        width: 100%;
    }
}
