/* ==========================================================
   GSMXPRO.IN - GLOBAL STYLES
   ========================================================== */

:root {
    --bg: #030b0f;
    --bg-soft: #061219;
    --panel: #0b1720;
    --panel-2: #0f1d28;
    --border: #203847;
    --border-soft: #172b36;
    --text: #f4f8fa;
    --muted: #8fa3ad;
    --muted-2: #b8c8cf;
    --green: #00e889;
    --green-dark: #00c977;
    --blue: #4da3ff;
    --yellow: #ffcf38;
    --danger: #ff5f6d;
    --shadow: 0 18px 50px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(0,232,137,.035), transparent 30%),
        linear-gradient(180deg, #020a0e 0%, #031016 55%, #02090d 100%);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover { color: var(--green); }

img { max-width: 100%; }

button,
input,
select,
textarea { font: inherit; }

button,
.btn { cursor: pointer; }

.container {
    width: min(1100px, calc(100% - 32px));
    margin-inline: auto;
}

main {
    min-height: calc(100vh - 150px);
    padding: 0 0 60px;
}

/* ==========================================================
   HEADER
   ========================================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 28px;
    background: rgba(3, 11, 15, .96);
    border-bottom: 1px solid #172a35;
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.3px;
    white-space: nowrap;
}

.brand-mark {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    border: 1px solid var(--green);
    border-radius: 8px;
    color: var(--green);
    font-size: 13px;
    font-weight: 900;
}

.x,
.accent { color: var(--green); }

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    color: #d4e0e5;
    font-size: 13px;
    font-weight: 800;
}

.nav a:hover,
.nav a.active {
    color: #fff;
    background: #0c1c27;
    box-shadow: inset 0 -2px 0 var(--green);
}

.menu {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #07151b;
    color: var(--text);
}

/* ==========================================================
   TYPOGRAPHY / COMMON
   ========================================================== */

h1, h2, h3, p { margin-top: 0; }

h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 24px; line-height: 1.25; }
h3 { font-size: 18px; line-height: 1.3; }

.muted { color: var(--muted); }

.eyebrow {
    margin-bottom: 10px;
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.panel {
    background: linear-gradient(180deg, rgba(15,29,40,.96), rgba(7,17,25,.99));
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.notice {
    padding: 13px 15px;
    border: 1px solid rgba(0,232,137,.25);
    border-radius: 10px;
    background: rgba(0,232,137,.07);
    color: #dfffee;
}

.notice.error {
    border-color: rgba(255,95,109,.35);
    background: rgba(255,95,109,.08);
    color: #ffd9dd;
}

/* ==========================================================
   FORM CONTROLS
   ========================================================== */

.input,
.select,
.search-input,
.search-form select {
    width: 100%;
    min-height: 38px;
    padding: 10px 12px;
    border: 1px solid #294556;
    border-radius: 9px;
    outline: none;
    background: #07151a;
    color: var(--text);
}

.input::placeholder,
.search-input::placeholder { color: #5e7784; }

.input:focus,
.select:focus,
.search-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(0,232,137,.08);
}

.field { margin-bottom: 16px; }
.field label {
    display: block;
    margin-bottom: 7px;
    color: #d7e3e8;
    font-size: 13px;
    font-weight: 700;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #001b11;
    box-shadow: 0 8px 20px rgba(0,232,137,.12);
}

.btn-small { min-height: 34px; padding: 7px 11px; font-size: 12px; }

/* ==========================================================
   TOOLS PAGE / FILTERS
   ========================================================== */

.page-head,
.resource-page,
.tools-page {
    width: min(1050px, calc(100% - 32px));
    margin: 0 auto;
    padding-top: 38px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
    color: #d5e0e5;
    font-size: 13px;
}

.breadcrumbs a { color: #d5e0e5; }
.breadcrumbs strong { color: var(--green); }

.page-head h1,
.resource-page h1,
.tools-page h1 { margin: 0 0 12px; }

.page-head > p,
.resource-page > p,
.tools-page > p {
    color: #9eb2bc;
    margin-bottom: 18px;
}

.filters,
.search-controls,
.resource-filter {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 8px;
    margin: 0 0 22px;
}

.filters .input,
.filters .select,
.search-controls .input,
.search-controls .select,
.resource-filter .input,
.resource-filter .select { min-height: 38px; }

/* ==========================================================
   RESOURCE LIST - 3 / 2 / 1 COLUMNS
   ========================================================== */

.resource-list,
.cards.resource-list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 18px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: stretch !important;
}

.resource-list .resource-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 300px;
    margin: 0 !important;
    padding: 20px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, rgba(16,29,40,.94), rgba(8,17,25,.98)) !important;
}

.resource-list .resource-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 125px;
    height: 2px;
    background: var(--green);
}

.resource-list .resource-top {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
}

.resource-list .resource-top .icon {
    flex: 0 0 68px !important;
    width: 68px !important;
    height: 68px !important;
    min-width: 68px !important;
    min-height: 68px !important;
    max-width: 68px !important;
    max-height: 68px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #294556 !important;
    border-radius: 14px !important;
    background: #07151a !important;
}

.resource-list .resource-top .icon img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    padding: 6px !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
}

.resource-list .resource-top .icon .icon-fallback,
.resource-list .resource-top .icon > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--green);
    font-size: 18px;
    font-weight: 900;
}

.resource-list .resource-top > div:last-child {
    min-width: 0;
    flex: 1 1 auto;
}

.resource-list .resource-top h3 {
    margin: 0 0 4px !important;
    color: var(--text) !important;
    font-size: 17px !important;
    line-height: 1.3 !important;
    font-weight: 800 !important;
    overflow-wrap: anywhere !important;
}

.resource-list .resource-top .muted {
    color: var(--muted) !important;
    font-size: 13px;
}

.resource-list .meta,
.resource-list .tags,
.resource-list .badges,
.resource-list .resource-tags {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap !important;
    gap: 5px !important;
    width: 100%;
    margin: 0 0 10px !important;
}

.badge,
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    border: 1px solid #29404e;
    border-radius: 7px;
    background: #0b1821;
    color: #c2d0d7;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.badge.green { border-color: rgba(0,232,137,.4); color: var(--green); background: rgba(0,232,137,.08); }
.badge.blue { border-color: rgba(77,163,255,.4); color: #63adff; background: rgba(77,163,255,.08); }
.badge.yellow { border-color: rgba(255,207,56,.4); color: var(--yellow); background: rgba(255,207,56,.08); }

.resource-list .description,
.resource-list .resource-description,
.resource-list .desc {
    flex: 1 1 auto !important;
    margin: 0 !important;
    color: var(--muted-2) !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere !important;
}

.resource-list .resource-bottom,
.resource-list .card-bottom,
.resource-list .card-foot {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    margin-top: auto !important;
    padding-top: 14px !important;
    border-top: 1px solid #1a2a35 !important;
}

.resource-list .downloads,
.resource-list .download-count,
.resource-list .card-foot small {
    color: var(--muted);
    font-size: 12px;
}

.resource-list .resource-bottom .btn,
.resource-list .card-bottom .btn,
.resource-list .card-foot .btn {
    flex: 0 0 auto;
}

/* ==========================================================
   FOOTER
   ========================================================== */

.footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    width: 100%;
    min-height: 90px;
    padding: 24px max(28px, calc((100% - 1100px) / 2));
    border-top: 1px solid #172a35;
    background: rgba(3,11,15,.7);
}

.footer > div { min-width: 0; }
.footer > div:last-child { text-align: right; }
.footer strong { display: block; margin-bottom: 4px; font-size: 14px; }
.footer small { display: block; color: var(--muted); font-size: 12px; }
.footer a {
    display: inline-flex;
    align-items: center;
    margin: 0 4px;
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
}

/* ==========================================================
   SEARCH OVERLAY
   ========================================================== */

#searchOverlay {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    background: rgba(0,0,0,.72) !important;
}

#searchOverlay.show { display: flex !important; }

#searchOverlay .search-modal {
    position: relative;
    width: min(600px, 100%) !important;
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 22px !important;
}

#searchOverlay .search-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

#searchOverlay .search-modal-head h2 { margin: 0; }

#searchOverlay .close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

#searchOverlay .close:hover { color: var(--green); background: #0b1b23; }

#searchOverlay .search-form {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

#searchOverlay .search-form .input { flex: 1; }
#searchOverlay .search-help { margin: 12px 0 0; }
body.search-open { overflow: hidden; }

/* ==========================================================
   SEARCH RESULTS PAGE
   ========================================================== */

.search-page-wrap {
    width: min(1050px, calc(100% - 32px));
    margin: 0 auto;
    padding-top: 38px;
}

.search-eyebrow { color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: 1px; }
.search-title { margin: 8px 0 8px; }
.search-sub { color: var(--muted); margin-bottom: 24px; }
.search-form:not(#searchOverlay .search-form) {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.search-form:not(#searchOverlay .search-form) .search-input { flex: 1 1 300px; }
.search-btn { min-height: 40px; border: 0; border-radius: 10px; padding: 9px 18px; background: var(--green); color: #001b11; font-weight: 900; cursor: pointer; }
.search-panel { padding: 35px; text-align: center; background: #07151a; border: 1px solid var(--border); border-radius: 14px; }
.search-panel h3 { margin-bottom: 8px; }
.search-panel p { margin: 0; color: var(--muted); }
.search-results-box { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: #07151a; }
.search-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.search-table th { padding: 14px 16px; color: var(--green); text-align: left; font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.search-table td { padding: 14px 16px; color: #d7e3e8; border-bottom: 1px solid #16262e; }
.search-table tr:last-child td { border-bottom: 0; }
.search-table tr:hover td { background: #0b1c24; }
.search-type-badge { display: inline-flex; padding: 4px 9px; border: 1px solid rgba(0,232,137,.3); border-radius: 999px; color: var(--green); background: rgba(0,232,137,.08); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.search-action-btn { display: inline-flex; padding: 8px 12px; border-radius: 8px; background: var(--green); color: #001b11; font-size: 12px; font-weight: 900; white-space: nowrap; }

/* ==========================================================
   TOOL DETAIL
   ========================================================== */

.tool-detail-page {
    width: min(1050px, calc(100% - 32px)) !important;
    margin: 0 auto !important;
    padding-top: 0;
}

.tool-single-card {
    position: relative;
    width: 100%;
    padding: 28px !important;
    box-sizing: border-box !important;
    overflow: hidden;
    text-align: left;
}

.tool-single-card .tool-single-icon {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 110px !important;
    height: 110px !important;
    min-width: 110px !important;
    min-height: 110px !important;
    max-width: 110px !important;
    max-height: 110px !important;
    flex: 0 0 110px !important;
    margin: 0 auto 22px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid #294556 !important;
    border-radius: 14px !important;
    background: #07151a !important;
}

.tool-single-card .tool-single-icon img {
    display: block !important;
    width: 100px !important;
    height: 100px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100px !important;
    max-height: 100px !important;
    flex: 0 0 100px !important;
    margin: 0 !important;
    padding: 5px !important;
    box-sizing: border-box !important;
    object-fit: contain !important;
    object-position: center !important;
}

.tool-single-card .tool-single-fallback {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    color: var(--green) !important;
    font-size: 28px !important;
    font-weight: 900 !important;
}

.tool-single-title { margin: 0 0 12px !important; font-size: 32px; line-height: 1.2; }
.tool-single-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tool-single-description { color: var(--muted-2); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.tool-single-description p { margin: 0; }
.tool-single-download { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #1a2a35; }
.tool-single-download-button { min-height: 42px; }
.tool-single-download-count { color: var(--muted); font-size: 12px; }

/* ==========================================================
   ADMIN / LOGIN
   ========================================================== */

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); padding: 28px; }

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 1000px) {
    .resource-list,
    .cards.resource-list { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
    .filters,
    .search-controls,
    .resource-filter { grid-template-columns: 1fr 1fr; }
    .filters .btn,
    .search-controls .btn,
    .resource-filter .btn { width: 100%; }
}

@media (max-width: 700px) {
    .topbar { min-height: 62px; padding: 0 14px; }
    .menu { display: inline-flex; align-items: center; justify-content: center; }
    .brand { margin-right: auto; font-size: 16px; }
    .nav {
        position: absolute;
        top: calc(100% + 1px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 10px 14px 14px;
        background: #030b0f;
        border-bottom: 1px solid #172a35;
    }
    .nav.open { display: flex; }
    .nav a { justify-content: center; min-height: 42px; }

    .container,
    .page-head,
    .resource-page,
    .tools-page,
    .search-page-wrap,
    .tool-detail-page { width: calc(100% - 24px) !important; }

    .page-head,
    .resource-page,
    .tools-page,
    .search-page-wrap { padding-top: 26px; }

    .filters,
    .search-controls,
    .resource-filter { grid-template-columns: 1fr; }

    .resource-list,
    .cards.resource-list { grid-template-columns: 1fr !important; gap: 14px !important; }
    .resource-list .resource-card { min-height: 0; padding: 16px !important; }
    .resource-list .resource-top .icon { width: 64px !important; height: 64px !important; min-width: 64px !important; min-height: 64px !important; max-width: 64px !important; max-height: 64px !important; flex-basis: 64px !important; }
    .resource-list .resource-top h3 { font-size: 16px !important; }
    .resource-list .resource-bottom,
    .resource-list .card-bottom,
    .resource-list .card-foot { align-items: stretch !important; flex-direction: column !important; }
    .resource-list .resource-bottom .btn,
    .resource-list .card-bottom .btn,
    .resource-list .card-foot .btn { width: 100%; }

    .footer { grid-template-columns: 1fr; gap: 12px; padding: 22px 14px; }
    .footer > div:last-child { text-align: left; }

    #searchOverlay { padding: 12px !important; }
    #searchOverlay .search-form { flex-direction: column; }
    #searchOverlay .search-form .btn { width: 100%; }

    .tool-single-card { padding: 20px !important; }
    .tool-single-card .tool-single-icon { width: 90px !important; height: 90px !important; min-width: 90px !important; min-height: 90px !important; max-width: 90px !important; max-height: 90px !important; flex-basis: 90px !important; }
    .tool-single-card .tool-single-icon img { width: 82px !important; height: 82px !important; max-width: 82px !important; max-height: 82px !important; flex-basis: 82px !important; }
    .tool-single-title { font-size: 25px; }
    .tool-single-download { align-items: stretch; flex-direction: column; }
    .tool-single-download-button { width: 100%; }
}
/* ==========================================================
   TOOL DETAIL - CENTER ALIGN
   ========================================================== */

.tool-single-card {
    text-align: center !important;
}

/* Icon center */
.tool-single-card .tool-single-icon {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Title center */
.tool-single-card .tool-single-title {
    text-align: center !important;
}

/* Badges center */
.tool-single-card .tool-single-badges {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

/* Description center */
.tool-single-card .tool-single-description {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Download area center */
.tool-single-card .tool-single-download {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    text-align: center !important;
}

/* Download count */
.tool-single-card .tool-single-download-count {
    text-align: center !important;
}

/* Breadcrumb can remain left aligned */
.tool-detail-page .breadcrumbs {
    text-align: left !important;
}
/* TOOL DETAIL - FINAL CENTER SPACING */

.tool-single-card {
    text-align: center !important;
}

.tool-single-icon {
    margin: 0 auto 22px !important;
}

.tool-single-title {
    margin: 0 0 12px !important;
    text-align: center !important;
}

.tool-single-badges {
    justify-content: center !important;
    margin-bottom: 14px !important;
}

.tool-single-description {
    max-width: 900px !important;
    margin: 0 auto !important;
    text-align: center !important;
    line-height: 1.65 !important;
}

.tool-single-download {
    justify-content: center !important;
    margin-top: 18px !important;
    text-align: center !important;
}
/* ==========================================================
   PAGINATION
   ========================================================== */

.pagination {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 28px 0 10px !important;
}

.pagination a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-width: 40px !important;
    height: 40px !important;

    padding: 0 12px !important;

    box-sizing: border-box !important;

    border: 1px solid var(--border) !important;
    border-radius: 9px !important;

    background: #0b1821 !important;
    color: var(--text) !important;

    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

.pagination a:hover,
.pagination a.active {
    background: var(--green) !important;
    border-color: var(--green) !important;
    color: #001b11 !important;
}

.pagination-prev,
.pagination-next {
    padding-left: 15px !important;
    padding-right: 15px !important;
}