/* ================================================================
   Business Card Studio — Frontend Styles
   ================================================================ */

/* ── Variables ── */
:root {
    --bcs-primary  : #6c47ff;
    --bcs-primary-h: #5235d4;
    --bcs-accent   : #ff6b6b;
    --bcs-green    : #06d6a0;
    --bcs-text     : #1a1a2e;
    --bcs-muted    : #6b7280;
    --bcs-border   : #e5e7eb;
    --bcs-bg       : #f9fafb;
    --bcs-white    : #ffffff;
    --bcs-radius   : 12px;
    --bcs-shadow   : 0 4px 24px rgba(0,0,0,0.08);
    --bcs-shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
    --bcs-font     : 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size      : 15px;
}

/* ── App Wrapper ── */
.bcs-app {
    font-family: var(--bcs-font);
    color      : var(--bcs-text);
    max-width  : 1100px;
    margin     : 0 auto;
    padding    : 0 16px 40px;
    position   : relative;
}

/* ── Status Bar ── */
.bcs-status-bar {
    display        : flex;
    align-items    : center;
    gap            : 12px;
    padding        : 10px 20px;
    border-radius  : var(--bcs-radius);
    font-size      : 0.88rem;
    margin-bottom  : 20px;
    font-weight    : 500;
}
.bcs-status-pro   { background: linear-gradient(90deg, #06d6a01a, #06d6a033); border: 1px solid #06d6a0; color: #065f46; }
.bcs-status-trial { background: linear-gradient(90deg, #6c47ff1a, #6c47ff2a); border: 1px solid #6c47ff; color: #3730a3; }
.bcs-upgrade-link { color: var(--bcs-primary); font-weight: 700; text-decoration: none; }
.bcs-upgrade-link:hover { text-decoration: underline; }

/* ── Layout ── */
.bcs-layout {
    display              : grid;
    grid-template-columns: 380px 1fr;
    gap                  : 24px;
    align-items          : start;
}
@media (max-width: 800px) {
    .bcs-layout { grid-template-columns: 1fr; }
}

/* ── Panels ── */
.bcs-panel {
    background   : var(--bcs-white);
    border-radius: var(--bcs-radius);
    box-shadow   : var(--bcs-shadow);
    padding      : 24px;
    border       : 1px solid var(--bcs-border);
}
.bcs-panel-title {
    font-size    : 1rem;
    font-weight  : 700;
    margin       : 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bcs-border);
    color        : var(--bcs-text);
}

/* ── Form ── */
.bcs-section { margin-bottom: 20px; }
.bcs-section h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bcs-muted); margin: 0 0 12px; }
.bcs-field { margin-bottom: 12px; }
.bcs-field label {
    display    : block;
    font-size  : 0.82rem;
    font-weight: 600;
    color      : var(--bcs-text);
    margin-bottom: 5px;
}
.bcs-required { color: #ef4444; }
.bcs-field input,
.bcs-field textarea,
.bcs-field select {
    width        : 100%;
    padding      : 9px 12px;
    border       : 1.5px solid var(--bcs-border);
    border-radius: 8px;
    font-family  : var(--bcs-font);
    font-size    : 0.9rem;
    color        : var(--bcs-text);
    transition   : border-color .2s, box-shadow .2s;
    box-sizing   : border-box;
    background   : var(--bcs-bg);
}
.bcs-field input:focus,
.bcs-field textarea:focus {
    outline     : none;
    border-color: var(--bcs-primary);
    box-shadow  : 0 0 0 3px rgba(108,71,255,.12);
    background  : #fff;
}
.bcs-field textarea { resize: vertical; min-height: 60px; }
.bcs-field small { font-size: 0.75rem; color: var(--bcs-muted); }
.bcs-field input[type="file"] { padding: 6px; background: #fff; }

/* Optional section */
.bcs-optional-section {
    border   : 1.5px solid var(--bcs-border);
    border-radius: 8px;
    padding  : 0;
    margin-bottom: 20px;
}
.bcs-optional-section summary {
    padding    : 10px 14px;
    font-size  : 0.88rem;
    font-weight: 600;
    cursor     : pointer;
    color      : var(--bcs-primary);
    list-style : none;
}
.bcs-optional-section summary::-webkit-details-marker { display: none; }
.bcs-optional-section .bcs-section { padding: 4px 14px 14px; }

/* ── Media Upload Section ── */
.bcs-section-media.bcs-locked {
    position: relative;
    opacity : 0.7;
}
.bcs-locked-overlay {
    padding      : 16px;
    background   : linear-gradient(135deg, #f3f0ff, #fdf4ff);
    border-radius: 8px;
    text-align   : center;
    font-size    : 0.88rem;
    line-height  : 1.7;
    border       : 1.5px dashed #c4b5fd;
}

/* ── Template Grid ── */
.bcs-template-grid {
    display              : grid;
    grid-template-columns: repeat(5, 1fr);
    gap                  : 8px;
}
.bcs-template-thumb {
    aspect-ratio  : 1.6;
    border-radius : 6px;
    cursor        : pointer;
    display       : flex;
    flex-direction: column;
    align-items   : center;
    justify-content: center;
    border        : 2.5px solid transparent;
    transition    : transform .15s, border-color .15s;
    padding       : 4px;
    gap           : 2px;
}
.bcs-template-thumb:hover { transform: scale(1.05); }
.bcs-template-thumb.active { border-color: var(--bcs-primary); box-shadow: 0 0 0 3px rgba(108,71,255,.2); }
.bcs-thumb-emoji { font-size: 1.2rem; }
.bcs-thumb-name  { font-size: 0.62rem; font-weight: 700; text-align: center; }

/* ── Toggle Groups ── */
.bcs-toggle-group { display: flex; gap: 6px; flex-wrap: wrap; }
.bcs-toggle {
    padding      : 7px 14px;
    border       : 1.5px solid var(--bcs-border);
    border-radius: 20px;
    background   : var(--bcs-white);
    font-size    : 0.82rem;
    font-weight  : 600;
    cursor       : pointer;
    color        : var(--bcs-muted);
    transition   : all .15s;
    font-family  : var(--bcs-font);
}
.bcs-toggle:hover { border-color: var(--bcs-primary); color: var(--bcs-primary); }
.bcs-toggle.active { background: var(--bcs-primary); color: #fff; border-color: var(--bcs-primary); }

/* ── Buttons ── */
.bcs-btn {
    display      : inline-flex;
    align-items  : center;
    justify-content: center;
    gap          : 6px;
    padding      : 10px 20px;
    border-radius: 8px;
    font-weight  : 700;
    font-size    : 0.88rem;
    cursor       : pointer;
    border       : none;
    text-decoration: none;
    transition   : all .2s;
    font-family  : var(--bcs-font);
}
.bcs-btn-primary {
    background: var(--bcs-primary);
    color     : #fff;
}
.bcs-btn-primary:hover { background: var(--bcs-primary-h); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(108,71,255,.35); color: #fff; }
.bcs-btn-secondary {
    background: var(--bcs-bg);
    color     : var(--bcs-text);
    border    : 1.5px solid var(--bcs-border);
}
.bcs-btn-secondary:hover { border-color: var(--bcs-primary); color: var(--bcs-primary); background: #f5f3ff; }
.bcs-btn-upgrade {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color     : #fff;
    margin-top: 8px;
}
.bcs-btn-upgrade:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(239,68,68,.35); color: #fff; }
.bcs-btn-wa {
    background: #25d366;
    color     : #fff;
}
.bcs-btn-wa:hover { background: #1ebe5d; color: #fff; }
.bcs-btn-small { padding: 6px 14px; font-size: 0.78rem; }

/* ── Card Preview ── */
.bcs-preview-wrapper {
    position       : relative;
    display        : flex;
    justify-content: center;
    margin-bottom  : 20px;
}
.bcs-card-preview {
    /* Horizontal: standard 89mm×54mm ratio = 1.648:1 */
    width       : 100%;
    max-width   : 380px;
    aspect-ratio: 1.648;
    padding     : 20px;
    box-sizing  : border-box;
    position    : relative;
    overflow    : hidden;
    display     : flex;
    gap         : 14px;
    box-shadow  : 0 10px 40px rgba(0,0,0,0.18);
}
.bcs-card-preview.bcs-layout-vertical {
    aspect-ratio   : 0.607;      /* 54/89 */
    max-width      : 200px;
    flex-direction : column;
    padding        : 16px;
}

/* Card sections */
.bcs-card-left  { display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.bcs-card-center{ flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.bcs-card-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-start; flex-shrink: 0; }
.bcs-card-vert-top { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bcs-card-vert-content { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; flex: 1; }

/* Card elements */
.bcs-card-name {
    font-size  : clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow   : hidden;
    text-overflow: ellipsis;
    color      : var(--text-primary, #1a1a1a);
}
.bcs-card-title {
    font-size  : clamp(0.62rem, 1.5vw, 0.75rem);
    font-weight: 500;
    color      : var(--text-secondary, #555);
}
.bcs-card-tagline {
    font-size  : clamp(0.55rem, 1.2vw, 0.65rem);
    font-style : italic;
    color      : var(--accent, #6c47ff);
    opacity    : 0.9;
}
.bcs-card-divider {
    height      : 2px;
    width       : 40px;
    border-radius: 2px;
    margin      : 4px 0;
    background  : var(--accent-line, #6c47ff);
}
.bcs-card-vert-content .bcs-card-divider { margin: 4px auto; }
.bcs-card-contacts,
.bcs-card-extras {
    display    : flex;
    flex-direction: column;
    gap        : 2px;
}
.bcs-card-contacts span,
.bcs-card-extras span {
    font-size   : clamp(0.5rem, 1.1vw, 0.62rem);
    white-space : nowrap;
    overflow    : hidden;
    text-overflow: ellipsis;
    color       : var(--text-secondary, #555);
}
.bcs-card-photo {
    width        : 52px;
    height       : 52px;
    border-radius: 50%;
    overflow     : hidden;
    flex-shrink  : 0;
    border       : 2px solid var(--accent-line, rgba(255,255,255,0.3));
}
.bcs-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.bcs-card-photo.bcs-initials {
    display        : flex;
    align-items    : center;
    justify-content: center;
    font-weight    : 800;
    font-size      : 1.1rem;
    color          : #fff;
}
.bcs-card-logo {
    max-width  : 60px;
    max-height : 36px;
    object-fit : contain;
}
.bcs-card-company-name {
    font-size  : 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align : right;
}
.bcs-card-qr-embed {
    display        : flex;
    align-items    : center;
    justify-content: center;
}
.bcs-card-qr-embed canvas,
.bcs-card-qr-embed img { max-width: 64px; max-height: 64px; }

/* Watermark overlay */
.bcs-watermark {
    position   : absolute;
    bottom     : 0;
    left       : 0;
    right      : 0;
    background : rgba(0,0,0,0.65);
    color      : rgba(255,255,255,0.9);
    font-size  : 0.58rem;
    font-weight: 600;
    text-align : center;
    padding    : 4px;
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* ── QR Preview Area ── */
.bcs-qr-area {
    display       : flex;
    flex-direction: column;
    align-items   : center;
    gap           : 6px;
    padding       : 16px;
    background    : var(--bcs-bg);
    border-radius : 8px;
    margin-bottom : 20px;
    border        : 1.5px solid var(--bcs-border);
}
.bcs-qr-label { font-size: 0.75rem; color: var(--bcs-muted); font-weight: 600; margin: 0; }
#bcs-qr-container canvas, #bcs-qr-container img { max-width: 96px; height: auto; border-radius: 4px; }

/* ── Export Section ── */
.bcs-export-section h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bcs-muted); margin: 0 0 12px; }
.bcs-export-grid { display: grid; gap: 8px; }
.bcs-export-grid .bcs-btn { width: 100%; }
.bcs-export-info  { font-size: 0.75rem; color: var(--bcs-muted); margin: 8px 0 0; }
.bcs-trial-notice { font-size: 0.75rem; color: #d97706; background: #fef3c7; padding: 6px 10px; border-radius: 6px; margin: 8px 0 0; }

/* ── Pro Badge ── */
.bcs-pro-badge {
    display      : inline-block;
    padding      : 2px 8px;
    background   : linear-gradient(135deg, #f59e0b, #ef4444);
    color        : #fff;
    border-radius: 20px;
    font-size    : 0.65rem;
    font-weight  : 800;
    vertical-align: middle;
    margin-left  : 6px;
    letter-spacing: 0.05em;
}

/* ── Loading Overlay ── */
#bcs-loader {
    position       : fixed;
    inset          : 0;
    background     : rgba(0,0,0,0.55);
    display        : flex;
    align-items    : center;
    justify-content: center;
    z-index        : 99999;
    display        : none;
}
.bcs-loader-inner {
    background   : #fff;
    border-radius: 16px;
    padding      : 32px 40px;
    text-align   : center;
    box-shadow   : var(--bcs-shadow-lg);
}
.bcs-loader-inner p { margin: 12px 0 0; font-weight: 600; color: var(--bcs-text); }
.bcs-spinner {
    width        : 40px;
    height       : 40px;
    border       : 4px solid #e5e7eb;
    border-top   : 4px solid var(--bcs-primary);
    border-radius: 50%;
    animation    : bcs-spin .8s linear infinite;
    margin       : 0 auto;
}
@keyframes bcs-spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
#bcs-toast {
    position     : fixed;
    bottom       : 32px;
    left         : 50%;
    transform    : translateX(-50%) translateY(80px);
    background   : var(--bcs-text);
    color        : #fff;
    padding      : 12px 24px;
    border-radius: 30px;
    font-size    : 0.88rem;
    font-weight  : 600;
    z-index      : 99999;
    transition   : transform .3s cubic-bezier(.34,1.56,.64,1);
    pointer-events: none;
    white-space  : nowrap;
}
#bcs-toast.bcs-toast-show { transform: translateX(-50%) translateY(0); }
#bcs-toast.bcs-toast-error { background: #ef4444; }
#bcs-toast.bcs-toast-success { background: #065f46; }

/* ── Prompts (login/expired) ── */
.bcs-prompt {
    text-align   : center;
    padding      : 60px 40px;
    background   : var(--bcs-white);
    border-radius: var(--bcs-radius);
    box-shadow   : var(--bcs-shadow);
    max-width    : 460px;
    margin       : 40px auto;
}
.bcs-prompt-icon { font-size: 3.5rem; margin-bottom: 16px; }
.bcs-prompt h3   { font-size: 1.4rem; margin: 0 0 12px; color: var(--bcs-text); }
.bcs-prompt p    { color: var(--bcs-muted); margin-bottom: 24px; }
.bcs-pricing-card {
    background   : var(--bcs-bg);
    border-radius: 12px;
    padding      : 24px;
    border       : 1.5px solid var(--bcs-border);
    text-align   : left;
    margin-top   : 16px;
}
.bcs-price {
    font-size  : 1.8rem;
    font-weight: 800;
    color      : var(--bcs-primary);
    margin-bottom: 12px;
}
.bcs-price span { font-size: 0.9rem; font-weight: 500; color: var(--bcs-muted); }
.bcs-feature-list { list-style: none; padding: 0; margin: 0 0 20px; }
.bcs-feature-list li { padding: 5px 0; font-size: 0.9rem; border-bottom: 1px solid var(--bcs-border); }
.bcs-feature-list li:last-child { border-bottom: none; }
.bcs-pricing-card .bcs-btn { width: 100%; justify-content: center; }

/* ── Upgrade Page ── */
.bcs-upgrade-page { max-width: 700px; margin: 0 auto; padding: 40px 20px; font-family: var(--bcs-font); }
.bcs-upgrade-hero { text-align: center; margin-bottom: 40px; }
.bcs-upgrade-hero h2 { font-size: 1.8rem; color: var(--bcs-text); }
.bcs-upgrade-hero p  { color: var(--bcs-muted); font-size: 1.05rem; }
.bcs-pricing-table {
    display              : grid;
    grid-template-columns: 1fr 1.2fr;
    gap                  : 20px;
}
@media (max-width: 560px) { .bcs-pricing-table { grid-template-columns: 1fr; } }
.bcs-plan {
    background   : var(--bcs-white);
    border       : 2px solid var(--bcs-border);
    border-radius: 16px;
    padding      : 28px;
}
.bcs-plan h3 { font-size: 1.1rem; margin: 0 0 12px; }
.bcs-plan ul { list-style: none; padding: 0; margin: 16px 0 24px; }
.bcs-plan ul li { padding: 7px 0; font-size: 0.9rem; border-bottom: 1px solid var(--bcs-border); }
.bcs-plan ul li:last-child { border-bottom: none; }
.bcs-plan-featured {
    border-color: var(--bcs-primary);
    box-shadow  : 0 0 0 4px rgba(108,71,255,0.1);
    position    : relative;
}
.bcs-popular-badge {
    position     : absolute;
    top          : -14px;
    left         : 50%;
    transform    : translateX(-50%);
    background   : var(--bcs-primary);
    color        : #fff;
    padding      : 4px 18px;
    border-radius: 20px;
    font-size    : 0.72rem;
    font-weight  : 800;
    letter-spacing: 0.05em;
}
.bcs-plan .bcs-btn { width: 100%; justify-content: center; }

/* ─────────── Admin Styles ─────────── */
.bcs-admin-wrap { max-width: 1000px; }
.bcs-stats-grid {
    display              : grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap                  : 16px;
    margin               : 24px 0;
}
.bcs-stat-card {
    background   : #fff;
    border-radius: 12px;
    padding      : 24px;
    text-align   : center;
    box-shadow   : 0 2px 12px rgba(0,0,0,0.07);
    border       : 1px solid #e5e7eb;
    display      : flex;
    flex-direction: column;
    align-items  : center;
    gap          : 6px;
}
.bcs-stat-number { font-size: 2.5rem; font-weight: 800; color: #1a1a2e; }
.bcs-stat-label  { font-size: 0.8rem; font-weight: 600; color: #6b7280; }
.bcs-stat-pro    .bcs-stat-number { color: #059669; }
.bcs-stat-trial  .bcs-stat-number { color: #6c47ff; }
.bcs-stat-expired .bcs-stat-number { color: #ef4444; }
.bcs-badge { display:inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; }
.bcs-badge-pro     { background: #d1fae5; color: #065f46; }
.bcs-badge-trial   { background: #ede9fe; color: #4c1d95; }
.bcs-badge-expired { background: #fee2e2; color: #991b1b; }
.bcs-users-table th, .bcs-users-table td { vertical-align: middle; padding: 10px 12px; }
.bcs-quick-links { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.bcs-shortcode-info { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; }
.bcs-shortcode-info h3 { margin: 0 0 8px; font-size: 0.9rem; }
.bcs-shortcode-info code { background: #1a1a2e; color: #06d6a0; padding: 4px 10px; border-radius: 4px; display: inline-block; margin: 3px 0; font-size: 0.85rem; }
