/* =============================================
   IRON Brand Design System
   Primary:  #CC1418 (Crimson Red)
   Steel:    #4A4A4A (Dark Gray / Icon color)
   Dark:     #111111 (Near Black)
   Light:    #F5F5F5 (Off White)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --iron-red: #CC1418;
    --iron-red-dark: #A00F12;
    --iron-red-light: #E8191E;
    --iron-steel: #4A4A4A;
    --iron-steel-lt: #6B6B6B;
    --iron-dark: #111111;
    --iron-card: #1A1A1A;
    --iron-surface: #222222;
    --iron-white: #FFFFFF;
    --iron-offwhite: #F5F5F5;
    --iron-muted: #8A8A8A;
    --card-radius: 28px;
    --font-family: 'Inter', 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(160deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
    color: var(--iron-white);
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-y: auto;
    padding: 24px 0 40px;
}

/* ── Card Container ── */
.card-container {
    width: 385px;
    position: relative;
    perspective: 1000px;
}

.card {
    width: 100%;
    background-color: var(--iron-card);
    border-radius: var(--card-radius);
    overflow: visible;
    position: relative;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(204, 20, 24, 0.12);
    display: flex;
    flex-direction: column;
    margin-bottom: 40px;
}

.card.back {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    overflow: hidden;
}

.card.hidden {
    opacity: 0;
    pointer-events: none;
    transform: rotateY(180deg) scale(0.95);
}

/* ── Header / Photo Area ── */
.header {
    position: relative;
    height: 420px;
    width: 100%;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    overflow: hidden;
}

.staff-photo {
    height: 100%;
    width: 100%;
}

.staff-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    filter: grayscale(20%) contrast(1.05);
}

/* Red accent bar at top of photo */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--iron-red), var(--iron-red-light));
    z-index: 3;
}

/* Dark gradient over photo for text readability */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(17, 17, 17, 0.5) 40%,
            rgba(17, 17, 17, 0.95) 100%);
    z-index: 1;
}

/* ── Staff Info Overlay ── */
.staff-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 2;
}

.name {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    line-height: 1.1;
}

.title {
    font-size: 1rem;
    color: var(--iron-muted);
    font-weight: 400;
    margin-bottom: 12px;
}

.company {
    display: none;
    /* Hidden — company shown via logo below */
}

/* IRON Logo block */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.logo img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
    /* White version on dark bg */
    object-fit: contain;
}

/* Fallback text logo */
.logo-t {
    background-color: var(--iron-red);
    color: #fff;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -1px;
}

.logo-text {
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: 2px;
    color: var(--iron-white);
}

/* ── Action Buttons ── */
.action-buttons {
    display: flex;
    gap: 12px;
    padding: 18px 20px;
    justify-content: flex-start;
}

.action-btn {
    background-color: var(--iron-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--iron-white);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.action-btn:hover {
    background-color: var(--iron-red);
    border-color: var(--iron-red);
    box-shadow: 0 4px 16px rgba(204, 20, 24, 0.4);
}

/* LinkedIn button uses its own brand blue on hover */
#linkedinBtn:hover {
    background-color: #0A66C2;
    border-color: #0A66C2;
    box-shadow: 0 4px 16px rgba(10, 102, 194, 0.4);
}

.action-btn:active {
    transform: scale(0.9);
}

/* ── About Section ── */
.about-section {
    background-color: var(--iron-offwhite);
    color: #111;
    margin: 0 14px;
    padding: 22px 20px 16px;
    border-radius: 22px 22px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.about-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
}

.description {
    color: #555;
    line-height: 1.5;
    text-align: center;
    font-size: 0.95rem;
}

/* ── Contact Section ── */
.contact-us-section {
    background-color: var(--iron-offwhite);
    color: #111;
    margin: 0 14px;
    padding: 18px 20px 20px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.contact-us-header {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 14px;
}

.contact-icon {
    background: linear-gradient(135deg, var(--iron-red), var(--iron-red-dark));
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(204, 20, 24, 0.3);
}

.contact-us-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item h4 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--iron-red);
    margin-bottom: 2px;
}

.contact-item p {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
}

.direction-btn {
    background: linear-gradient(135deg, var(--iron-red), var(--iron-red-dark));
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    width: fit-content;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(204, 20, 24, 0.35);
}

.direction-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(204, 20, 24, 0.45);
}

/* ── Bottom Navigation ── */
.bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background-color: var(--iron-surface);
    border-radius: 22px;
    margin: 10px 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-btn {
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--iron-white);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.nav-btn:hover {
    background-color: var(--iron-red);
    border-color: var(--iron-red);
    box-shadow: 0 3px 12px rgba(204, 20, 24, 0.4);
}

.add-contact-btn {
    background: linear-gradient(135deg, var(--iron-red), var(--iron-red-dark));
    border: none;
    color: #fff;
    padding: 0 16px;
    height: 52px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    font-weight: 700;
    flex-grow: 1;
    margin-left: 10px;
    justify-content: space-between;
    transition: transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 4px 18px rgba(204, 20, 24, 0.45);
}

.add-contact-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(204, 20, 24, 0.55);
}

.add-contact-btn:active {
    transform: scale(0.97);
}

.btn-text {
    font-size: 0.95rem;
    line-height: 1.1;
    text-align: left;
    flex-grow: 1;
}

.add-contact-btn .plus-icon {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
}

/* ── QR Back Card ── */
.back {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 32px;
    text-align: center;
    background: linear-gradient(160deg, #1a1a1a 0%, #111111 100%);
    border: 1px solid rgba(204, 20, 24, 0.2);
}

/* Red top bar on QR card */
.back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--iron-red), var(--iron-red-light));
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.qr-header {
    margin-bottom: 14px;
}

.qr-header h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--iron-white);
}

.qr-header p {
    color: var(--iron-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.qr-instructions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    width: 100%;
}

.qr-step {
    font-size: 0.82rem;
    color: var(--iron-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 8px 14px;
    text-align: left;
}

/* QR Code box */
.qrcode-container {
    background-color: #fff;
    padding: 16px;
    border-radius: 18px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* IRON logo inside QR panel */
.qr-brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.qr-brand-logo img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

/* Save Contact button */
.save-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--iron-red), var(--iron-red-dark));
    color: #fff;
    text-decoration: none;
    padding: 13px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 18px rgba(204, 20, 24, 0.45);
    cursor: pointer;
    letter-spacing: 0.2px;
}

.save-contact-link:hover,
.save-contact-link:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(204, 20, 24, 0.3);
}

/* Back to Card button */
.close-qr {
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 13px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.close-qr:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

/* ── Responsive ── */
@media (max-width: 400px) {
    .card-container {
        width: 100vw;
        border-radius: 0;
    }

    .card {
        border-radius: 0;
    }

    .header {
        border-radius: 0;
    }
}