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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    margin: 0;
    padding: 0;
    width: 100vw;
    height: var(--actual-vh, 100vh);
    overflow: hidden;
}

.business-card {
    width: 100vw;
    height: var(--actual-vh, 100vh);
    background: white;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.business-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #f9f9f9 25%, transparent 25%),
        linear-gradient(-45deg, #f9f9f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f9f9f9 75%),
        linear-gradient(-45deg, transparent 75%, #f9f9f9 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.02;
    pointer-events: none;
}

.card-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: var(--dynamic-padding, 20px);
    text-align: center;
    gap: var(--dynamic-gap, 20px);
}

.name {
    font-size: var(--dynamic-name-size, 32px);
    font-weight: bold;
    color: #333;
    letter-spacing: 1px;
    margin: 0;
    text-transform: uppercase;
    flex-shrink: 0;
}

.qr-container {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--dynamic-gap, 15px);
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 0;
}

.qr-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--dynamic-padding, 20px);
    width: 100%;
    justify-content: center;
}

.qr-title {
    font-size: var(--dynamic-qr-title-size, 16px);
    color: #666;
    font-weight: 500;
    margin: 0;
    text-align: center;
    min-width: var(--dynamic-qr-title-size, 16px);
    flex-shrink: 0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    height: var(--dynamic-qr-size, 250px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-image {
    width: var(--dynamic-qr-size, 250px);
    height: var(--dynamic-qr-size, 250px);
    object-fit: cover;
    background: #f8f9fa;
    padding: calc(var(--dynamic-padding, 20px) * 0.5);
    border-radius: calc(var(--dynamic-padding, 20px) * 0.75);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin: 0;
    cursor: pointer;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qr-image:empty::before {
    content: '📱 Click to add QR';
    color: #999;
    font-size: calc(var(--dynamic-text-size, 20px) * 0.8);
    text-align: center;
}

.qr-image:hover {
    border-color: #4a90e2;
    background: #f0f7ff;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: calc(var(--dynamic-gap, 15px) * 0.3);
    flex-shrink: 0;
}

.title {
    font-size: var(--dynamic-title-size, 28px);
    color: #555;
    font-weight: 800;
    margin: 0;
}

.email,
.website,
.phone,
.calendar {
    font-size: var(--dynamic-text-size, 20px);
    color: #666;
    line-height: 1.2;
    margin: 0;
}

.email {
    font-weight: 500;
}

.website {
    color: #4a90e2;
}

.phone {
    font-weight: 600;
    color: #333;
}

.calendar {
    color: #4a90e2;
    font-weight: 500;
}

/* Dynamic sizing handles all responsive behavior */

/* Editable text styles */
.editable-text {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.editable-text:hover {
    background-color: rgba(74, 144, 226, 0.1);
    transform: scale(1.02);
}

.editable-text.editing {
    background-color: rgba(74, 144, 226, 0.2);
    outline: 2px solid #4a90e2;
}

/* Input overlay styles */
.text-input-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.text-input-dialog {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 400px;
}

.text-input-dialog h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.text-input-dialog input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 20px;
    font-family: inherit;
}

.text-input-dialog input:focus {
    outline: none;
    border-color: #4a90e2;
}

.text-input-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.text-input-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e8e8e8;
}

.btn-save {
    background: #4a90e2;
    color: white;
}

.btn-save:hover {
    background: #357abd;
}

/* QR Dialog specific styles */
.qr-dialog {
    width: 450px;
    max-width: 95%;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: #4a90e2;
}

.qr-options {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.option-text {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Gold dot styles */
.gold-dot {
    position: absolute;
    z-index: 999;
    top: 10px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    transition: all 0.2s ease;
}

.gold-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
}

/* Contact modal styles */
.contact-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.contact-modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.contact-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}

.contact-modal-close:hover,
.contact-modal-close:focus {
    color: #000;
}

.contact-modal-content p {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
}

.contact-modal-content a {
    color: #4a90e2;
    text-decoration: none;
}

.contact-modal-content a:hover {
    text-decoration: underline;
}
/* Safe area handling for mobile devices */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .card-content {
        padding-left: max(var(--dynamic-padding, 20px), env(safe-area-inset-left));
        padding-right: max(var(--dynamic-padding, 20px), env(safe-area-inset-right));
        padding-top: max(var(--dynamic-padding, 20px), env(safe-area-inset-top));
        padding-bottom: max(var(--dynamic-padding, 20px), env(safe-area-inset-bottom));
    }
}

/* Responsive QR title positioning */
@media (max-width: 480px) {
    .qr-title {
        font-size: 12px;
        min-width: 60px;
    }
    
    .qr-image {
        width: 180px;
        height: 180px;
    }
}
