* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #25D366;
    --primary-dark: #128C7E;
    --secondary-color: #34B7F1;
    --background: #f5f5f5;
    --surface: #ffffff;
    --text-primary: #1f1f1f;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

header h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.upload-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--background);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(37, 211, 102, 0.05);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 16px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-upload {
    background: var(--primary-color);
    color: white;
    width: 100%;
    margin-top: 20px;
    padding: 14px;
}

.btn-upload:hover {
    background: var(--primary-dark);
}

.btn-upload:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn-copy {
    background: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    margin-left: 8px;
}

.file-info {
    margin-top: 20px;
}

.file-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 16px;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.file-size {
    color: var(--text-secondary);
    font-size: 14px;
}

.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    display: block;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.result-section,
.error-section {
    text-align: center;
    padding: 20px;
}

.result-icon,
.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.result-icon {
    color: var(--success-color);
}

.error-icon {
    color: var(--error-color);
}

.result-section h2 {
    color: var(--success-color);
    margin-bottom: 12px;
}

.error-section h2 {
    color: var(--error-color);
    margin-bottom: 12px;
}

.result-message,
.error-message {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.result-url {
    margin: 24px 0;
    text-align: left;
}

.result-url label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.url-display {
    display: flex;
    gap: 8px;
}

.url-display input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--background);
    color: var(--text-primary);
}

.url-display input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.instructions {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.instructions h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.instructions ol {
    margin-left: 20px;
    color: var(--text-secondary);
}

.instructions li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.hidden {
    display: none !important;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Install Banner */
.install-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
    z-index: 100;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.install-text {
    flex: 1;
}

.install-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.install-text p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.btn-install {
    background: white;
    color: var(--primary-color);
    padding: 10px 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.btn-install:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.btn-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.8;
}

.btn-close:hover {
    opacity: 1;
}

/* Installation Steps */
.install-steps {
    margin: 20px 0;
}

.step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.step-content ul {
    margin: 8px 0 0 20px;
    color: var(--text-secondary);
}

.step-content li {
    margin-bottom: 4px;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

.note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 20px;
    color: #856404;
}

.note strong {
    display: block;
    margin-bottom: 4px;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    header h1 {
        font-size: 24px;
    }

    .upload-section {
        padding: 20px;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .url-display {
        flex-direction: column;
    }

    .btn-copy {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }

    .install-content {
        flex-wrap: wrap;
    }

    .install-text {
        width: 100%;
        margin-bottom: 8px;
    }

    .btn-install {
        width: 100%;
    }

    .step {
        flex-direction: column;
        gap: 12px;
    }
}

