/* iOS App Distribution - Stylesheet */

:root {
    --primary-color: #007AFF;
    --primary-hover: #0056CC;
    --secondary-color: #5856D6;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    --bg-color: #F2F2F7;
    --card-bg: #FFFFFF;
    --text-primary: #1C1C1E;
    --text-secondary: #8E8E93;
    --border-color: #C6C6C8;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

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

/* Header */
header {
    text-align: center;
    padding: 30px 0;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Upload Section */
.upload-section {
    margin-bottom: 24px;
}

.drop-zone {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
}

.drop-zone-content {
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.drop-zone p {
    font-size: 16px;
    margin-bottom: 4px;
}

.drop-zone .hint {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Progress Section */
.progress-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.progress-bar {
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* App Info Section */
.app-info-section {
    margin-bottom: 24px;
}

.app-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.app-icon-container {
    flex-shrink: 0;
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: var(--bg-color);
    object-fit: cover;
}

.app-details {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-version,
.app-bundle-id {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Actions */
.actions {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #E5E5EA;
}

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

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-color);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.qr-code {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.qr-code canvas {
    border-radius: 8px;
}

.qr-hint {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Config Section */
.config-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.config-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.config-form label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.config-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease;
}

.config-form input:focus {
    border-color: var(--primary-color);
}

.config-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Manifest Section */
.manifest-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.manifest-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.code-block {
    position: relative;
    background: #1C1C1E;
    border-radius: 8px;
    overflow: hidden;
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
    color: #E5E5EA;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.footer-hint {
    margin-top: 4px;
    font-size: 12px;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1001;
    animation: toast-in 0.3s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

    header h1 {
        font-size: 24px;
    }

    .actions {
        flex-direction: column;
    }

    .app-card {
        flex-direction: column;
        text-align: center;
    }

    .app-details {
        text-align: center;
    }
}
