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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #000000 0%, #1a1a2e 100%);
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 3px solid #00d9ff;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00d9ff 0%, #00ff88 100%);
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header p {
    opacity: 0.85;
    font-size: 1rem;
    color: #00d9ff;
}

form {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    color: #00d9ff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.section-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00d9ff;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.form-group input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
}

.help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Image Upload Styling */
.image-upload-container {
    margin-top: 0.5rem;
}

.image-preview {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.image-preview img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto 1rem;
}

.remove-image-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
    display: block;
    margin: 0 auto;
}

.remove-image-btn:hover {
    background: #c82333;
}

/* Dynamic Table Rows */
.screen-row,
.mapping-row {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    position: relative;
}

.row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.row-title {
    font-weight: 600;
    color: #00d9ff;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.remove-btn:hover {
    background: #c82333;
}

.row-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
}

.field label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #555;
}

.field input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.add-btn {
    background: #00ff88;
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s;
    width: 100%;
    border: 2px solid transparent;
}

.add-btn:hover {
    background: #00d9ff;
    border-color: #00ff88;
    transform: translateY(-1px);
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

.submit-btn {
    background: linear-gradient(135deg, #00d9ff 0%, #00ff88 100%);
    color: #000;
    border: none;
    padding: 1rem 3rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 217, 255, 0.6);
}

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

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-left: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.download-btn:hover {
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.pdf-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    margin-left: 1rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.pdf-btn:hover {
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.6);
}

@media (max-width: 768px) {
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .download-btn,
    .pdf-btn {
        margin-left: 0;
    }
}

.status-message {
    margin: 2rem;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

footer {
    background: #f8f9fa;
    padding: 1.5rem;
    text-align: center;
    border-top: 3px solid #00d9ff;
    margin-top: 2rem;
}

footer p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeIn 0.5s ease-out;
}

.screen-row,
.mapping-row {
    animation: fadeIn 0.3s ease-out;
}

/* Native Mappings Preview */
.native-mappings-preview {
    background: #e8f9ff;
    border: 2px solid #00d9ff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.native-mappings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.native-mapping-item {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    display: grid;
    grid-template-columns: 80px 150px 1fr;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mapping-number {
    font-weight: 700;
    color: #00d9ff;
    font-size: 1rem;
}

.mapping-resolution {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.mapping-description {
    color: #555;
    font-size: 0.9rem;
}

.form-section h3 {
    color: #333;
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem 0;
    font-weight: 600;
}

.form-section h3:first-of-type {
    margin-top: 1rem;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .row-fields {
        grid-template-columns: 1fr;
    }

    .submit-btn {
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }

    .native-mapping-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .mapping-number,
    .mapping-resolution,
    .mapping-description {
        text-align: left;
    }
}
