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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.card-preview-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card-preview {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card-preview.theme-modern {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.card-preview.theme-elegant {
    background: #f8f8f8;
    border: 2px solid #333;
}

.card-preview.theme-minimal {
    background: white;
    border: 1px solid #ddd;
}

.card-header {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.card-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.photo-placeholder {
    color: #999;
    font-size: 0.9rem;
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-main-info {
    flex: 1;
}

.card-name {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 5px;
}

.card-title {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 3px;
}

.card-company {
    font-size: 1rem;
    color: #888;
}

.card-contact {
    margin-bottom: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #555;
}

.contact-icon {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
}

.contact-text {
    font-size: 0.95rem;
}

.card-qr {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#qrCanvas {
    margin: 0 auto 10px;
}

.qr-hint {
    font-size: 0.85rem;
    color: #999;
    line-height: 1.4;
}

.input-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.input-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.theme-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.theme-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.theme-btn:hover:not(.active) {
    border-color: #667eea;
    color: #667eea;
}

.remove-photo-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.remove-photo-btn:hover {
    background: #c0392b;
}

.action-section {
    grid-column: 1 / -1;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.action-btn.primary {
    background: #667eea;
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.action-btn.primary:hover {
    background: #5a64d8;
}

.info-section {
    grid-column: 1 / -1;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.info-section h2 {
    color: #333;
    margin-bottom: 15px;
}

.info-section ol {
    padding-left: 25px;
    color: #666;
}

.info-section li {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card-preview {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .action-section {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}

@media print {
    body {
        background: white;
    }
    
    .container {
        padding: 0;
    }
    
    header,
    .input-section,
    .action-section,
    .info-section {
        display: none;
    }
    
    main {
        display: block;
    }
    
    .card-preview-section {
        box-shadow: none;
        padding: 0;
    }
    
    .card-preview {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}