/* style.css - Styles pour le portail central d'équipe Kiki Traiteur */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');

:root {
    --primary-red: #E52424;
    --primary-red-glow: rgba(229, 36, 36, 0.15);
    --primary-dark: #0F172A;
    --primary-indigo: #6C5CE7;
    --text-magenta: #9D178D;
    --bg-slate: #0B0F19;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-white: #F8FAFC;
    --text-gray: #94A3B8;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-slate);
    color: var(--text-white);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(229, 36, 36, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(108, 92, 231, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Header & Navigation */
header.portal-header {
    padding: 30px 5%;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.portal-logo {
    width: 50px;
    height: 50px;
}

.portal-brand-text h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #FFF 0%, #E2E8F0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-brand-text p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--primary-red);
    letter-spacing: 0.5px;
}

.portal-nav {
    display: flex;
    gap: 15px;
}

.btn-nav {
    background: transparent;
    color: var(--text-white);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-nav:hover, .btn-nav.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    box-shadow: 0 4px 14px var(--primary-red-glow);
}

/* Main Container Layout */
.portal-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 40px;
}

@media (max-width: 1024px) {
    .portal-container {
        grid-template-columns: 1fr;
    }
    
    .phone-simulator-sticky {
        display: none !important; /* Hide simulator on medium screens, they can visit cards directly */
    }
}

/* Left Section: Directory & Admin */
.left-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Search and Filters Bar */
.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    backdrop-filter: blur(8px);
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-wrapper svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

.search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 12px 12px 45px;
    color: var(--text-white);
    font-size: 0.92rem;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-red);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-red-glow);
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-tag:hover, .filter-tag.active {
    background: rgba(229, 36, 36, 0.15);
    border-color: var(--primary-red);
    color: var(--text-white);
}

/* Grid of Team Cards */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.team-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-indigo);
    opacity: 0;
    transition: var(--transition);
}

.team-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.team-card.active {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 1px var(--primary-red), 0 10px 25px rgba(229, 36, 36, 0.1);
}

.team-card.active::before {
    background: var(--primary-red);
    opacity: 1;
}

.team-card:hover::before {
    opacity: 1;
}

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

.card-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-red) 0%, #B91C1C 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.card-meta {
    flex: 1;
}

.card-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-white);
    margin-bottom: 4px;
}

.card-role {
    font-size: 0.82rem;
    color: var(--text-gray);
    font-weight: 400;
}

.card-details-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.preview-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.preview-detail svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    opacity: 0.7;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-card-action {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-card-action.btn-view {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border: 1px solid var(--border-color);
}

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

.btn-card-action.btn-qr {
    background: rgba(108, 92, 231, 0.1);
    color: #A29BFE;
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.btn-card-action.btn-qr:hover {
    background: var(--primary-indigo);
    color: white;
}

/* Right Section: Mobile Simulator Sticky */
.phone-simulator-sticky {
    position: sticky;
    top: 110px;
    height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Beautiful Phone Container */
.phone-frame {
    width: 320px;
    height: 640px;
    background: #000;
    border-radius: 40px;
    border: 12px solid #1E293B;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5), 
        0 0 0 2px rgba(255, 255, 255, 0.05),
        0 0 30px rgba(108, 92, 231, 0.15);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Smartphone notch */
.phone-notch {
    width: 140px;
    height: 25px;
    background: #1E293B;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-notch::before {
    content: '';
    width: 40px;
    height: 4px;
    background: #0F172A;
    border-radius: 2px;
    margin-bottom: 2px;
}

/* Phone Screen iframe */
.phone-screen {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-gray);
    padding-top: 15px; /* space for notch */
}

.simulator-label {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.simulator-label svg {
    color: #4AD1A9;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Modal and QR Popups */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.qr-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.qr-content {
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: var(--transition);
}

.qr-modal.show .qr-content {
    transform: scale(1);
}

.qr-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.qr-subtitle {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 24px;
}

.qr-image-wrapper {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 24px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
}

.qr-image-wrapper img {
    display: block;
    width: 200px;
    height: 200px;
}

.btn-close {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

/* Admin panel / Card Creator Form */
.admin-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 35px;
    backdrop-filter: blur(8px);
}

.admin-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-title svg {
    color: var(--primary-red);
}

.admin-subtitle {
    font-size: 0.88rem;
    color: var(--text-gray);
    margin-bottom: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-white);
    font-size: 0.92rem;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--primary-red);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-red-glow);
}

.admin-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
}

.btn-admin {
    padding: 14px 28px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
}

.btn-admin.btn-save {
    background: var(--primary-red);
    color: white;
    box-shadow: 0 4px 14px var(--primary-red-glow);
}

.btn-admin.btn-save:hover {
    background: #C81E1E;
    transform: translateY(-1px);
}

.btn-admin.btn-download {
    background: var(--primary-indigo);
    color: white;
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.2);
}

.btn-admin.btn-download:hover {
    background: var(--button-violet-hover);
    transform: translateY(-1px);
}

.btn-admin.btn-reset {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border: 1px solid var(--border-color);
}

.btn-admin.btn-reset:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Admin Live Preview Frame */
.preview-container-box {
    margin-top: 30px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.preview-box-title {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

/* Portal Footer */
footer.portal-footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-gray);
    font-size: 0.85rem;
    margin-top: 60px;
    background: rgba(15, 23, 42, 0.3);
}

footer.portal-footer a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
}

footer.portal-footer a:hover {
    text-decoration: underline;
}
