* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 400px;
}

/* Business Card Styles */
.business-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid #667eea;
}

.profile-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    margin: 0 auto 20px;
    border: 4px solid #667eea;
}

h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 5px;
}

h2 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: normal;
}

.company {
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.contact-info {
    text-align: left;
    margin-bottom: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.contact-item .icon {
    margin-right: 15px;
    font-size: 20px;
}

.contact-item a {
    color: #333;
    text-decoration: none;
    flex: 1;
}

.contact-item a:hover {
    color: #667eea;
}

/* QR Code Section */
.qr-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.qr-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

#qrcode {
    margin: 0 auto 10px;
    display: inline-block;
}

.qr-section p {
    color: #666;
    font-size: 14px;
}

/* Welcome Page Styles */
.welcome-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
}

.welcome-card h1 {
    color: #333;
    margin-bottom: 15px;
}

.welcome-card p {
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
}

.demo-links {
    margin-top: 20px;
}

.demo-links h3 {
    color: #333;
    margin-bottom: 15px;
}

.demo-link {
    display: block;
    background: #667eea;
    color: white;
    padding: 12px 20px;
    margin: 10px 0;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.demo-link:hover {
    background: #5a6fd8;
}

/* Error Page Styles */
.error-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
}

.error-card h1 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-card p {
    color: #666;
    margin-bottom: 25px;
    font-size: 16px;
}

.back-link {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Authentication Styles */
.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.auth-card h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #667eea;
    outline: none;
}

.auth-button {
    width: 100%;
    background: #667eea;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-button:hover {
    background: #5a6fd8;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
}

.success-message {
    background: #efe;
    color: #363;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #cfc;
}

/* Dashboard Styles */
.dashboard {
    max-width: 800px;
    width: 100%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

.add-card-form {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.add-card-form h2 {
    color: #333;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.user-cards {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card-preview {
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 20px;
    background: #fafafa;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-preview h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.card-preview p {
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.view-btn, .edit-btn {
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    flex: 1;
    text-align: center;
    transition: background 0.3s;
}

.view-btn {
    background: #667eea;
    color: white;
}

.edit-btn {
    background: #f39c12;
    color: white;
}

.view-btn:hover {
    background: #5a6fd8;
}

.edit-btn:hover {
    background: #e67e22;
}

.card-url input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.card-url input:focus {
    outline: none;
    border-color: #667eea;
}

/* Update welcome page to include auth links */
.welcome-card .auth-buttons {
    margin: 20px 0;
}

.welcome-card .auth-buttons a {
    display: inline-block;
    margin: 0 10px;
    padding: 12px 25px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
    transition: background 0.3s, transform 0.2s;
}

.welcome-card .auth-buttons a:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Profile Image Styles */
.profile-img-small {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
    display: block;
    margin: 0 auto 10px;
}

.profile-placeholder-small {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 10px;
    border: 3px solid #667eea;
}

/* File Input Styling */
.form-group input[type="file"] {
    padding: 8px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    background: #f8f9fa;
    width: 100%;
}

.form-group input[type="file"]:focus {
    border-color: #667eea;
    outline: none;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .business-card, .welcome-card, .error-card, .auth-card {
        padding: 25px 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .profile-img, .profile-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .dashboard {
        max-width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 15px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .welcome-card .auth-buttons a {
        display: block;
        margin: 10px 0;
    }
    
    .add-card-form, .user-cards {
        padding: 20px 15px;
    }
}

/* Tablet Responsive */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        max-width: 600px;
    }
    
    .dashboard {
        max-width: 100%;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation for smooth transitions */
.business-card, .welcome-card, .error-card, .auth-card, 
.add-card-form, .user-cards, .card-preview {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Print styles */
@media print {
    body {
        background: white !important;
    }
    
    .business-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .logout-btn, .auth-buttons, .card-actions {
        display: none;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
a:focus, button:focus, input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .business-card, .welcome-card, .error-card, .auth-card,
    .add-card-form, .user-cards {
        border: 2px solid #000;
    }
    
    .contact-item {
        border: 1px solid #000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .business-card, .welcome-card, .error-card, .auth-card,
    .add-card-form, .user-cards {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .business-card h1, .welcome-card h1, .auth-card h1,
    .add-card-form h2, .user-cards h2 {
        color: #f7fafc;
    }
    
    .business-card h2 {
        color: #90cdf4;
    }
    
    .company, .contact-item a, .card-preview p {
        color: #cbd5e0;
    }
    
    .contact-item {
        background: #4a5568;
    }
    
    .form-group input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .form-group input:focus {
        border-color: #90cdf4;
    }
    
    .card-preview {
        background: #4a5568;
        border-color: #718096;
    }
    
    .card-url input {
        background: #2d3748;
        border-color: #718096;
        color: #e2e8f0;
    }
}