/*  ========================================================================
    styles.css  –  Fabereye App-Catalog front-end
    ------------------------------------------------------------------------
    * Palette / variables
    * Base resets + typography
    * Global layout helpers
    * Top-bar  (hamburger, slide-out panel, auth buttons)
    * Grid & filter inputs
    * Application cards (+ tags, “FREE” badge)
    * Loader spinner
    * Footer
    ===================================================================== */

/*  ───────────────────────────────────────── Palette & variables ──────── */
:root {
    --bg-main:   #131f2b;
    --bg-card:   #1b3249;
    --bg-accent: #ff612d;
    --fg-main:   #bfc1ca;
    --fg-muted:  #7d8591;

    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 20px;
}

/*  ───────────────────────────────────────── Base + typography ────────── */
*,
*::before,
*::after { box-sizing:border-box; }

html,body {
    margin:0;
    padding:0;
    font-family:Arial, Helvetica, sans-serif;
    background:var(--bg-main);
    color:var(--fg-main);
    /* reserve space for fixed footer */
    padding-bottom:120px;
}

h1,h2,h3,h4,h5,h6 { margin:0; font-weight:700; }
a       { color:var(--bg-accent); text-decoration:none; }
img     { max-width:100%; height:auto; display:block; }

/*  ───────────────────────────────────────── Layout container ─────────── */
.container {
    width:90%;
    max-width:1200px;
    margin:0 auto;
    padding:50px 20px;
}

h1 {
    font-size:48px;
    text-align:center;
    margin-bottom:30px;
    color:var(--bg-accent);
}

/*  ───────────────────────────────────────── Filter inputs ────────────── */
.language-selector,
.tag-filter { display:inline-block; margin-bottom:20px; }

.language-selector select,
.tag-filter input {
    background:var(--bg-card);
    color:var(--fg-main);
    padding:5px 10px;
    border:none;
    border-radius:3px;
    cursor:pointer;
}

.tag-filter { margin-top:80px; }

/*  ───────────────────────────────────────── App grid  ─────────────────── */
.app-list {
    display:grid;
    gap:20px;
    grid-template-columns:1fr;
}

@media (min-width:600px)  { .app-list { grid-template-columns:repeat(2,1fr); } }
@media (min-width:1024px) { .app-list { grid-template-columns:repeat(3,1fr); } }

/*  ───────────────────────────────────────── App card  ─────────────────── */
.app-item{
    background:var(--bg-card);
    border-radius:var(--radius-sm);
    padding:20px;
    position:relative;
    padding-bottom:60px;          /* room for tag row */
    display:flex;                 /* align child blocks vertically */
    flex-direction:column;
}

.app-item h2{
    color:var(--bg-accent);
    font-size:24px;
    margin-bottom:8px;
    overflow-wrap:anywhere;
}

.app-item p{
    flex:1 1 auto;                /* fills remaining space */
    font-size:16px;
    line-height:1.5;
    margin-top:0;
    color:var(--fg-main);
}

.app-item.free::after{
	content:none;
}

/*  tag pills pinned bottom-left */
.tags{
    position:absolute;
    bottom:20px;
    left:20px;
    display:flex;
    flex-wrap:wrap;
    gap:6px;
}

.tag{
    font-size:12px;
    line-height:1;
    color:var(--fg-muted);
    background:rgba(255,255,255,0.05);
    padding:2px 8px;
    border-radius:12px;
    white-space:nowrap;
    user-select:none;
}

	/* NEW header layout: title left, badge fixed right */
	.card-head{
		display:grid;
		grid-template-columns:1fr auto;   /* 1 fr title, auto badge  */
		align-items:flex-start;           /* badge stays at top */
		column-gap:12px;                  /* space between them   */
		margin-bottom:8px;                /* space before description */
	}

	.card-head h2{                        /* keep existing override */
		margin:0;
		font-size:24px;
		color:var(--bg-accent);
		overflow-wrap:anywhere;
	}


.badge{
    flex-shrink:0;          /* badge never shrinks */
    background:var(--bg-accent);
    color:#fff;
    padding:2px 8px;
    border-radius:3px;
    font-size:12px;
    line-height:1;
}

/*  ───────────────────────────────────────── Top-bar: hamburger + panel ─ */
#menu-toggle{
    position:fixed;
    top:20px; right:20px;
    width:42px; height:42px;
    border:none;
    border-radius:6px;
    background:var(--bg-card);
    color:var(--fg-main);
    font-size:26px;               /* ☰ */
    cursor:pointer;
    transition:background .2s;
    z-index:1001;
}
#menu-toggle:hover,
#menu-toggle:focus-visible{ background:var(--bg-accent); color:#fff; }

#menu-panel{
    position:fixed;
    top:68px; right:20px;
    display:none;
    flex-direction:column;
    gap:12px;
    padding:14px 18px;
    width:clamp(170px,70vw,280px);
    background:var(--bg-card);
    border-radius:var(--radius-md);
    box-shadow:0 6px 18px rgba(0,0,0,.4);
    z-index:1001;
}
#menu-panel.open{ display:flex; }

@media(max-width:600px){
    #menu-panel{ width:calc(100% - 32px); right:16px; }
}

#user-info{
    font-weight:600;
    color:#fff;
    margin-bottom:8px;
    cursor:default;
}

#menu-panel select,
#menu-panel .auth-btn{
    width:100%;
}

/* hide fallback inline-header once JS moves controls into panel */
.topbar:not(.fallback) .language-selector,
.topbar:not(.fallback) .auth-actions{ display:none; }

/*  ───────────────────────────────────────── Auth buttons ─────────────── */
.auth-btn{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:0 16px;
    height:36px;
    font-size:14px;
    background:var(--bg-card);
    color:var(--fg-main);
    border:1px solid transparent;
    border-radius:var(--radius-lg);
    cursor:pointer;
    transition:background .2s,color .2s;
}
.auth-btn:hover,
.auth-btn:focus-visible{ background:var(--bg-accent); color:#fff; outline:none; }

/*  ───────────────────────────────────────── Loader spinner ───────────── */
.loader{
    border:4px solid #f3f3f3;
    border-top:4px solid var(--bg-accent);
    border-radius:50%;
    width:30px; height:30px;
    animation:spin 1s linear infinite;
    margin:20px auto;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

/*  ───────────────────────────────────────── Footer ────────────────────── */
.footer{
    position:fixed;
    bottom:0; left:0;
    width:100%;
    background:var(--bg-card);
    padding:20px;
    text-align:center;
    font-size:14px;
    color:var(--fg-main);
}
.footer a{ color:var(--bg-accent); }

/* base desktop style */
.auth-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:0 16px;
  height:36px;
  font-size:14px;
  line-height:1;
  cursor:pointer;
  border:1px solid transparent;
  border-radius:20px;
  background:var(--bg-card);
  color:var(--fg-main);
  transition:background .2s,color .2s;
}
.auth-btn:hover,
.auth-btn:focus-visible{ background:var(--bg-accent); color:#fff; }


/* mobile tweak: keep hit target, shorten label */
@media (max-width:600px){
  .auth-btn{
    padding:0 12px;
  }
  .auth-btn .label{
    font-size:0;          /* visually gone */
    position:absolute;
    width:1px; height:1px;
    padding:0; overflow:hidden;
    clip:rect(0 0 0 0);            /* sr-only pattern */
    white-space:nowrap;            /* keep for AT */
    border:0;
  }
}

/* ─── Auth modal overlay ──────────────────────────────────────────────── */
#auth-modal{
    position:fixed;
    inset:0;                                     /* full-screen */
    display:flex;                                /* center child */
    justify-content:center;
    align-items:center;
    background:rgba(0,0,0,.6);                   /* dim backdrop */
    z-index:1500;                                /* above menu (1001) */
}
#firebaseui-container{
    background:#fff;
    padding:2rem 2.5rem;
    border-radius:var(--radius-md,8px);
    box-shadow:0 8px 32px rgba(0,0,0,.35);
}

/* pointer + focus styles for the whole card */
.app-item {
    cursor: pointer;
    text-decoration: none;         /* remove underline */
    color: inherit;                /* keep current colours */
}
.app-item:hover,
.app-item:focus-visible {
    outline: 2px solid var(--bg-accent);
    outline-offset: 2px;
}

.menu-link{
  display:block;
  padding:8px 0;
  color:var(--fg-main);
}
.menu-link:hover,
.menu-link:focus-visible{
  color:#fff;
}

/* ─── FAQ page ─────────────────────────────────────────────── */
.faq-list{
  display:flex;
  flex-direction:column;
  gap:20px;
}
.faq-item{
  position:relative;                /* ← added here, drop 2nd rule */
  background:var(--bg-card);
  border-radius:var(--radius-sm);
  padding:20px;
}
.faq-item h3{
  margin:0 0 10px;
  color:var(--bg-accent);
}
.faq-item p{
  margin:0;
  line-height:1.5;
  color:var(--fg-main);
}

/* ─ FAQ search box ─────────────────────────────────────────── */
.faq-search{margin:0 0 24px;}
#faq-filter{
  width:420px;max-width:100%;
  padding:8px 12px;
  border-radius:var(--radius-sm);
  border:1px solid var(--bg-accent);
  background:var(--bg-card);
  color:var(--fg-main);
}

/* link icon ────────────────────────────────────────────────── */
.faq-anchor{
  position:absolute;top:12px;right:12px;
  width:1.25rem;height:1.25rem;
  opacity:.5;cursor:pointer;
}
.faq-anchor::before{content:"🔗";font-size:1.25rem;line-height:1}
.faq-item:hover .faq-anchor,
.faq-anchor:focus-visible{opacity:1}

