/* =============================================================================
   ARKAD EASY BIZCARD - PROFILE CARD STYLES
   =============================================================================

   This CSS file controls the appearance of the public profile page.
   You can customize these styles to match your brand.

   CUSTOMIZATION GUIDE:
   - Colors: Modify the color values (hex, rgb, or hsl)
   - Fonts: Change font-family properties
   - Spacing: Adjust padding and margin values
   - Borders: Modify border-radius for rounded corners
   - Effects: Add/remove shadows, gradients, transitions

   STRUCTURE:
   1. Profile Container - Main wrapper
   2. Profile Header - Photo, name, role, company
   3. Info Section - Contact details card
   4. Info Items - Individual contact rows
   5. Download Section - Save contact button
   6. Toast Notifications - Copy feedback
   7. Responsive Styles - Mobile adjustments

   ============================================================================= */


/* =============================================================================
   1. PROFILE CONTAINER
   Main wrapper that centers and constrains the profile width
   ============================================================================= */

.profile-container {
    width: 100%;
    max-width: 480px;                    /* Maximum width of the card */
    margin: 0 auto;                      /* Center horizontally */
    padding: 20px;                       /* Outer padding */
}

/* Logo at top of profile page */
.profile-logo {
    text-align: center;
    margin-bottom: 20px;
}

.profile-logo img {
    max-width: 150px;
    height: auto;
    object-fit: contain;
}

/* Logo sizes from settings */
[data-logo-size="small"] .profile-logo img {
    max-width: 100px;
}

[data-logo-size="medium"] .profile-logo img {
    max-width: 150px;
}

[data-logo-size="large"] .profile-logo img {
    max-width: 200px;
}

[data-logo-size="xlarge"] .profile-logo img {
    max-width: 280px;
}


/* =============================================================================
   2. PROFILE HEADER
   Contains the profile photo, name, role, company, and tagline
   ============================================================================= */

.profile-header {
    text-align: center;
    padding: 40px 24px 32px;
    background: linear-gradient(
        180deg,
        rgba(255, 206, 92, 0.08) 0%,
        transparent 100%
    );
    border-radius: 16px;
    margin-bottom: 16px;
}

/* Profile Photo Container */
.photo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;                  /* Circular photo */
    overflow: hidden;
    border: 3px solid var(--color-primary, #FFCE5C);
    background: var(--color-card-bg, #1a1a1a);
}

.photo-container.hidden {
    display: none;
}

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

/* Name */
.profile-name {
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text, #EEECE9);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

/* Job Title / Role */
.profile-role {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-primary, #FFCE5C);  /* Accent color for role */
    margin: 0 0 4px;
}

/* Company Name */
.profile-company {
    font-size: 14px;
    color: var(--color-text, #EEECE9);
    opacity: 0.7;
    margin: 0 0 8px;
}

/* Tagline / Bio */
.profile-tagline {
    font-size: 14px;
    font-style: italic;
    color: var(--color-text, #EEECE9);
    opacity: 0.6;
    margin: 12px 0 0;
}


/* =============================================================================
   3. INFO SECTION
   Container for the contact information card
   ============================================================================= */

.info-section {
    padding: 0;
}

.info-card {
    background: var(--color-card-bg, #1a1a1a);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 16px;
    padding: 8px 0;
}


/* =============================================================================
   4. INFO ITEMS
   Individual contact information rows (email, phone, website, etc.)
   ============================================================================= */

.info-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    transition: background 0.2s ease;
    cursor: default;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Icon Container */
.info-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 206, 92, 0.1);   /* Yellow tinted background */
    border-radius: 10px;
}

.info-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-primary, #FFCE5C);
}

/* Content (Label + Value) */
.info-content {
    flex: 1;
    min-width: 0;                          /* Allows text truncation */
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text, #EEECE9);
    opacity: 0.5;
}

.info-value {
    font-size: 15px;
    color: var(--color-text, #EEECE9);
    word-break: break-word;
}

/* Clickable Links */
.info-link {
    color: var(--color-text, #EEECE9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.info-link:hover {
    color: var(--color-primary, #FFCE5C);
}

/* Copy Button */
.copy-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--color-text, #EEECE9);
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.copy-btn:hover svg {
    opacity: 1;
}

/* Copy Success State */
.copy-btn.copied {
    background: rgba(76, 175, 80, 0.2);    /* Green success color */
    border-color: rgba(76, 175, 80, 0.4);
}

.copy-btn.copied svg {
    stroke: #4CAF50;
    opacity: 1;
}


/* =============================================================================
   5. DOWNLOAD SECTION
   Save contact button at the bottom
   ============================================================================= */

.download-section {
    padding: 0;
    margin-top: 16px;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 24px;
    background: var(--color-primary, #FFCE5C);
    color: var(--color-btn-text, #000000);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 16px;
}

.download-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-btn-text, #000000);
}


/* =============================================================================
   6. TOAST NOTIFICATIONS
   Feedback messages for copy actions
   ============================================================================= */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}


/* =============================================================================
   7. RESPONSIVE STYLES
   Adjustments for different screen sizes
   ============================================================================= */

@media (max-width: 480px) {
    .profile-container {
        padding: 12px;
    }

    .profile-header {
        padding: 32px 20px 24px;
    }

    .photo-container {
        width: 100px;
        height: 100px;
    }

    .profile-name {
        font-size: 24px;
    }

    .info-item {
        padding: 14px 16px;
        gap: 12px;
    }

    .info-icon {
        width: 36px;
        height: 36px;
    }

    .info-icon svg {
        width: 18px;
        height: 18px;
    }

    .copy-btn {
        width: 32px;
        height: 32px;
    }

    .download-btn {
        padding: 16px 20px;
        font-size: 14px;
    }
}


/* =============================================================================
   8. USER CARD VIEW (LOGGED IN USER)
   Styles for when user views their own card
   ============================================================================= */

.card-container {
    width: 100%;
    max-width: 420px;
}

.card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.business-card {
    background: var(--color-card-bg, #1a1a1a);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card-front {
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.card-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--color-primary, #FFCE5C);
}

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

.card-identity {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-role {
    font-size: 14px;
    opacity: 0.8;
}

.card-company {
    font-size: 13px;
    opacity: 0.6;
}


/* =============================================================================
   9. EDIT PROFILE STYLES
   ============================================================================= */

.edit-container {
    width: 100%;
    max-width: 600px;
}

.edit-card {
    background: var(--color-card-bg, #1a1a1a);
    border-radius: 16px;
    padding: 24px;
}

.edit-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 24px;
}

.edit-header h1 {
    margin-top: 8px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary, #FFCE5C);
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    transition: all 0.2s;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--color-primary, #FFCE5C);
}

.avatar-form {
    margin-bottom: 24px;
}

.avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
}

.current-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary, #FFCE5C);
    color: #000;
    font-size: 32px;
    font-weight: 600;
}

.avatar-placeholder.large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.avatar-actions input[type="file"] {
    display: none;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.form-section h2 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--color-primary, #FFCE5C);
}


/* =============================================================================
   10. USER CARD SCREEN - FLIPPING BUSINESS CARD
   This is the view users see when logged in - a flipping card with QR
   ============================================================================= */

.user-card-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 24px;
    /* Prevent layout shift during card flip */
    overflow: hidden;
}

/* Card Logo - positioned inside the card */
.card-logo {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.card-logo img {
    max-width: 100px;
    max-height: 40px;
    height: auto;
    object-fit: contain;
}

/* Business Card Container - Perspective for 3D flip */
.business-card-container {
    perspective: 1000px;
    margin: 0 auto;
}

/* Vertical card: tall and narrow */
.business-card-container.vertical {
    width: calc(70vh * 0.63);
    max-width: 90vw;
}

/* Horizontal card: wide and short */
.business-card-container.horizontal {
    width: calc(50vh * 1.586);
    max-width: 90vw;
}

/* Flipper - The element that rotates */
.business-card-flipper {
    position: relative;
    width: 100%;
    transition: transform 0.6s ease-in-out;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    cursor: pointer;
    will-change: transform;
}

/* Vertical orientation */
.business-card-container.vertical .business-card-flipper {
    height: 70vh;
    max-height: 700px;
}

/* Horizontal orientation */
.business-card-container.horizontal .business-card-flipper {
    height: 50vh;
    max-height: 400px;
}

/* Flipped state */
.business-card-container.flipped .business-card-flipper {
    transform: rotateY(180deg);
}

/* Card faces - Front and Back */
.business-card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(128, 128, 128, 0.15);
}

/* Front Side - Vertical layout (default) */
.business-card-front {
    position: relative;
    background: var(--color-card-bg, #1a1a1a);
    display: flex;
    flex-direction: column;
    padding: 30px;
}

/* Horizontal layout */
.business-card-container.horizontal .business-card-front {
    flex-direction: row;
    padding: 24px;
}

/* Avatar Section */
.card-avatar-section {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.business-card-container.horizontal .card-avatar-section {
    margin-bottom: 0;
    margin-right: 20px;
    align-items: center;
}

.card-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-primary, #FFCE5C);
    background: var(--color-bg, #0F1112);
}

.business-card-container.horizontal .card-avatar {
    width: 80px;
    height: 80px;
}

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

.card-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 600;
    color: var(--color-primary, #FFCE5C);
}

.business-card-container.horizontal .card-avatar-placeholder {
    font-size: 32px;
}

/* Card Content */
.business-card-front .card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
}

.business-card-container.horizontal .business-card-front .card-content {
    text-align: left;
    justify-content: center;
}

.business-card-front .card-identity {
    margin-bottom: 20px;
}

.business-card-container.horizontal .business-card-front .card-identity {
    margin-bottom: 16px;
}

.business-card-front .card-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text, #EEECE9);
    line-height: 1.2;
}

.business-card-front .card-role {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-primary, #FFCE5C);
    margin-bottom: 4px;
}

.business-card-front .card-company {
    font-size: 13px;
    color: var(--color-text, #EEECE9);
    opacity: 0.7;
    margin: 0;
}

.business-card-front .card-info {
    margin-top: auto;
    padding-bottom: 30px;
}

.business-card-front .info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--color-text, #EEECE9);
}

.business-card-front .info-row:last-child {
    margin-bottom: 0;
}

.business-card-front .info-row svg {
    width: 16px;
    height: 16px;
    stroke: var(--color-primary, #FFCE5C);
    flex-shrink: 0;
}

.business-card-container.horizontal .business-card-front .info-row {
    justify-content: flex-start;
}

/* Tap hint - front */
.card-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 10px;
    color: var(--color-primary, #FFCE5C);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.7;
}

/* Back Side - QR Code */
.business-card-back {
    background: var(--color-card-bg, #1a1a1a);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.qr-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#qrcode {
    background: #FFFFFF;
    padding: 15px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 16px;
}

#qrcode canvas,
#qrcode img {
    display: block;
    margin: 0 auto;
}

.qr-subtitle {
    font-size: 10px;
    color: var(--color-primary, #FFCE5C);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
    opacity: 0.7;
}

/* Card Action Buttons (back + logout) */
.card-actions {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}
.btn-card-action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text, #EEECE9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Responsive - Tablet */
@media (min-width: 768px) {
    .card-logo img {
        max-width: 120px;
    }

    .business-card-front .card-name {
        font-size: 28px;
    }

    .business-card-front .card-role {
        font-size: 16px;
    }

    .business-card-front .info-row {
        font-size: 14px;
    }

    .card-avatar {
        width: 120px;
        height: 120px;
    }
}

/* Responsive - Desktop */
@media (min-width: 1024px) {
    .card-logo img {
        max-width: 140px;
    }
}
