/* ===================================
   Kartvizit - Public Card View Styles
   =================================== */

.card-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: #667eea;
    background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card-page .loading-container,
.card-page .not-found-container {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.card-container {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg, #ffffff);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.card-cover {
    height: 140px;
    background-size: cover;
    background-position: center;
}

.card-cover-gradient {
    background: linear-gradient(135deg, var(--card-primary, #667eea) 0%, var(--card-secondary, #764ba2) 100%);
}

.card-profile {
    text-align: center;
    padding: 0 1.5rem;
    margin-top: -60px;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.profile-photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--card-primary, #667eea) 0%, var(--card-secondary, #764ba2) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 4px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.profile-photo-placeholder i {
    font-size: 3rem;
    color: white;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 1rem 0 0.25rem;
    color: #1a1a2e;
}

.profile-pronouns {
    font-size: 0.875rem;
    color: #6c757d;
}

.profile-title {
    font-size: 1rem;
    color: var(--card-primary, #667eea);
    font-weight: 500;
    margin: 0.5rem 0 0;
}

.profile-company {
    font-size: 0.9rem;
    color: #495057;
    margin: 0.25rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.company-logo {
    height: 24px;
    width: auto;
}

.profile-department {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
}

.card-bio {
    padding: 1rem 1.5rem;
    text-align: center;
}

.card-bio p {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.card-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 70px;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn i {
    font-size: 1.25rem;
}

.action-call {
    background: #198754;
    color: white;
}

.action-email {
    background: #0d6efd;
    color: white;
}

.action-web {
    background: #6c757d;
    color: white;
}

.action-save {
    background: var(--card-primary, #667eea);
    color: white;
}

.card-section {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin: 0 0 0.75rem;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.contact-item:hover {
    background: #e9ecef;
}

.contact-item i {
    font-size: 1.25rem;
    color: var(--card-primary, #667eea);
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-value {
    font-weight: 500;
    color: #1a1a2e;
}

.contact-label {
    font-size: 0.75rem;
    color: #6c757d;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--card-primary, #667eea);
}

.social-link:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: white;
}

.social-link i {
    font-size: 1.25rem;
}

.social-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.social-linkedin { background: #0077b5; }
.social-twitter, .social-x { background: #000000; }
.social-facebook { background: #1877f2; }
.social-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-github { background: #333; }
.social-youtube { background: #ff0000; }
.social-whatsapp { background: #25d366; }
.social-telegram { background: #0088cc; }
.social-tiktok { background: #000000; }

.location-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
}

.location-info i {
    color: var(--card-primary, #667eea);
}

.booking-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    background: var(--card-primary, #667eea);
    color: white;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.booking-btn:hover {
    opacity: 0.9;
    color: white;
}

.qr-section {
    text-align: center;
}

.qr-code {
    max-width: 150px;
    border-radius: 0.5rem;
}

/* Use card-footer-section to avoid Bootstrap .card-footer collision */
.card-footer-section {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #eee;
}

.powered-by {
    font-size: 0.75rem;
    color: #adb5bd;
    margin: 0;
}

/* ===================================
   Preview Frame (Admin Edit Page)
   =================================== */

.preview-frame {
    min-height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.preview-content {
    width: 100%;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
}

.preview-cover {
    height: 80px;
    background-size: cover;
    background-position: center;
}

.preview-cover-gradient {
    /* gradient set inline */
}

.preview-profile {
    text-align: center;
    padding: 0 1rem;
    margin-top: -40px;
}

.preview-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.preview-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    color: white;
    font-size: 2rem;
}

.preview-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0 0;
    color: #1a1a2e;
}

.preview-title {
    font-size: 0.8rem;
    color: #667eea;
    margin: 0.25rem 0;
}

.preview-company {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0;
}

.preview-bio {
    font-size: 0.75rem;
    color: #495057;
    padding: 0.75rem 1rem;
    margin: 0;
    text-align: center;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
}

.preview-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 767.98px) {
    .card-container {
        border-radius: 1rem;
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .card-cover {
        height: 120px;
    }

    .profile-photo,
    .profile-photo-placeholder {
        width: 100px;
        height: 100px;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .profile-title {
        font-size: 0.9rem;
    }

    .card-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .action-btn {
        flex: 1 1 calc(50% - 0.5rem);
        max-width: calc(50% - 0.25rem);
    }

    .social-links {
        justify-content: center;
    }

    .social-link {
        width: 48px;
        height: 48px;
    }

    .card-section {
        padding: 0.75rem 1rem;
    }

    .section-title {
        font-size: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .card-page {
        padding: 0;
        align-items: flex-start;
    }

    .card-container {
        border-radius: 0;
        max-width: 100%;
        margin: 0;
        min-height: 100vh;
    }

    .card-cover {
        height: 100px;
    }

    .profile-photo,
    .profile-photo-placeholder {
        width: 90px;
        height: 90px;
    }

    .card-profile {
        margin-top: -45px;
    }

    .profile-name {
        font-size: 1.35rem;
    }

    .action-btn {
        padding: 0.6rem 0.5rem;
        font-size: 0.75rem;
    }

    .action-btn i {
        font-size: 1.1rem;
    }

    .contact-item {
        padding: 0.6rem;
    }

    .booking-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .qr-code {
        max-width: 120px;
    }
}

/* iOS safe area support */
@supports (padding: max(0px)) {
    .card-page {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .card-container {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    .action-btn,
    .social-link,
    .contact-item,
    .booking-btn {
        min-height: 44px;
    }
}

/* Utility */
.form-control-color {
    padding: 0.25rem;
    height: 38px;
}
