/* =========================================================
   RESET
========================================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0e17;
    --surface: #131a2b;
    --surface2: #1a2340;

    --accent: #00e676;
    --accent2: #00b0ff;

    --danger: #ff5252;
    --warn: #ffd740;

    --text: #e0e6f0;
    --muted: #7a8ba8;

    --radius: 18px;

    --glow:
        0 0 30px rgba(0,230,118,.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        'Montserrat', sans-serif;

    background: var(--bg);
    color: var(--text);

    min-height: 100vh;

    line-height: 1.6;
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
    color: var(--accent);
}


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

header {
    position: sticky;
    top: 0;
    z-index: 100;

    padding: 16px 0;

    background:
        linear-gradient(
            135deg,
            rgba(19,26,43,.94),
            rgba(26,35,64,.94)
        );

    border-bottom:
        1px solid rgba(255,255,255,.06);

    backdrop-filter: blur(20px);
}

.header-inner {
    max-width: 1200px;

    margin: 0 auto;

    padding: 0 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 30px;
    font-weight: 800;

    letter-spacing: -1px;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent2)
        );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo1 {
    font-weight: 500;
}

.logo2 {
    font-size: 17px;
    font-weight: 500;
}

nav {
    display: flex;
    gap: 24px;
}

nav a {
    color: var(--muted);

    font-size: 14px;

    text-transform: uppercase;

    font-weight: 600;

    transition: color .2s;
}

nav a:hover {
    color: var(--accent);
}


/* =========================================================
   HERO
========================================================= */

.hero {
    text-align: center;

    padding:
        80px 24px 50px;

    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(0,230,118,.08),
            transparent 60%
        );
}

.badge {
    display: inline-block;

    margin-bottom: 20px;

    padding:
        7px 16px;

    border-radius: 100px;

    background:
        rgba(0,230,118,.1);

    border:
        1px solid rgba(0,230,118,.2);

    color: var(--accent);

    font-size: 13px;
    letter-spacing: 1px;
    font-weight: 700;
}

.hero h1 {
    font-size:
        clamp(34px, 5vw, 58px);

    font-weight: 850;

    line-height: 1.12;

    margin-bottom: 18px;
}

.hero h1 em {
    font-style: normal;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent2)
        );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    max-width: 650px;

    margin:
        0 auto;

    color: var(--muted);

    font-size: 18px;
}


/* =========================================================
   CONTAINER
========================================================= */

.container {
    max-width: 900px;

    margin: 0 auto;

    padding:
        0 24px 80px;
}


/* =========================================================
   UPLOAD
========================================================= */

.upload-zone {
    position: relative;

    overflow: hidden;

    padding:
        65px 24px;

    margin-bottom: 24px;

    text-align: center;

    background: var(--surface);

    border:
        2px dashed rgba(255,255,255,.1);

    border-radius: var(--radius);

    transition:
        .3s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);

    background:
        rgba(0,230,118,.03);

    box-shadow:
        var(--glow);
}

.upload-zone .icon {
    display: block;

    margin-bottom: 16px;

    font-size: 50px;
}

.upload-zone h3 {
    font-size: 21px;

    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--muted);

    font-size: 14px;
}

.upload-zone input {
    position: absolute;

    inset: 0;

    opacity: 0;

    cursor: pointer;
}


/* =========================================================
   PREVIEW
========================================================= */

.preview-area {
    display: none;

    padding: 20px;

    margin-bottom: 24px;

    background: var(--surface);

    border:
        1px solid rgba(255,255,255,.06);

    border-radius: var(--radius);
}

.preview-area.active {
    display: block;
}

.preview-area img {
    width: 100%;

    max-height: 420px;

    object-fit: contain;

    display: block;

    border-radius: 12px;

    background: var(--bg);
}

.preview-actions {
    display: flex;

    gap: 12px;

    justify-content: center;

    margin-top: 16px;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding:
        14px 28px;

    border: none;

    border-radius: 12px;

    font-size: 15px;

    font-weight: 700;

    transition:
        .2s;
}

.btn-primary {
    color: #000;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            #00c853
        );

    box-shadow:
        0 4px 20px rgba(0,230,118,.3);
}

.btn-primary:hover:not(:disabled) {
    transform:
        translateY(-2px);

    box-shadow:
        0 6px 30px rgba(0,230,118,.4);
}

.btn-primary:disabled {
    opacity: .5;

    cursor: not-allowed;
}

.btn-danger {
    color: var(--danger);

    background:
        rgba(255,82,82,.12);

    border:
        1px solid rgba(255,82,82,.2);
}

.btn-danger:hover {
    background:
        rgba(255,82,82,.18);
}


/* =========================================================
   LOADING
========================================================= */

.loading {
    display: none;

    padding: 45px;

    margin-bottom: 24px;

    text-align: center;

    background: var(--surface);

    border:
        1px solid rgba(255,255,255,.06);

    border-radius: var(--radius);
}

.loading.active {
    display: block;
}

.spinner {
    width: 48px;
    height: 48px;

    margin:
        0 auto 18px;

    border:
        3px solid rgba(255,255,255,.1);

    border-top-color:
        var(--accent);

    border-radius: 50%;

    animation:
        spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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


/* =========================================================
   RESULTS
========================================================= */

.results {
    display: none;

    overflow: hidden;

    margin-bottom: 24px;

    background: var(--surface);

    border:
        1px solid rgba(255,255,255,.08);

    border-radius: 20px;

    box-shadow:
        0 20px 60px rgba(0,0,0,.25);
}

.results.active {
    display: block;
}


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

.results-header {
    position: relative;

    display: flex;

    align-items: center;

    gap: 14px;

    padding:
        22px 24px;

    background:
        linear-gradient(
            135deg,
            rgba(0,230,118,.10),
            rgba(0,176,255,.08)
        );

    border-bottom:
        1px solid rgba(255,255,255,.07);
}

.results-header-icon {
    width: 46px;
    height: 46px;

    flex:
        0 0 46px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background:
        rgba(0,230,118,.1);

    font-size: 23px;
}

.results-header-label {
    color: var(--muted);

    font-size: 10px;

    font-weight: 800;

    letter-spacing:
        .14em;

    margin-bottom: 3px;
}

.results-header h3 {
    font-size: 20px;
    letter-spacing: 1px;
}

.analysis-status {
    margin-left: auto;

    display: flex;

    align-items: center;

    gap: 7px;

    padding:
        7px 11px;

    border-radius: 999px;

    background:
        rgba(255,255,255,.04);

    color: var(--muted);

    font-size: 12px;
}

.analysis-status span {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background:
        var(--accent);

    box-shadow:
        0 0 10px rgba(0,230,118,.7);
}


/* =========================================================
   RESULTS BODY
========================================================= */

.results-body {
    padding: 24px;
}


/* =========================================================
   MATCH
========================================================= */

.analysis-match {
    display: flex;

    align-items: center;

    gap: 16px;

    padding: 20px;

    margin-bottom: 20px;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,.035),
            rgba(255,255,255,.015)
        );

    border:
        1px solid rgba(255,255,255,.06);
}

.match-icon {
    width: 52px;
    height: 52px;

    flex:
        0 0 52px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 15px;

    background:
        rgba(0,176,255,.1);

    font-size: 25px;
}

.match-label {
    color: var(--muted);

    font-size: 10px;

    font-weight: 800;

    letter-spacing:
        .13em;

    margin-bottom: 4px;
}

.match-title {
    font-size: 20px;
    font-weight: 700;
}

.match-league {
    margin-top: 4px;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   GRID
========================================================= */

.analysis-grid {
    display: grid;

    grid-template-columns:
        minmax(260px,.8fr)
        minmax(300px,1.2fr);

    gap: 16px;

    margin-bottom: 16px;
}


/* =========================================================
   CARD
========================================================= */

.analysis-card {
    padding: 20px;

    background:
        rgba(255,255,255,.025);

    border:
        1px solid rgba(255,255,255,.06);

    border-radius: 16px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    font-size: 15px;
    font-weight: 700;
}

.card-title span {
    font-size: 18px;
}


/* =========================================================
   ODDS
========================================================= */

.odds-list {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.odds-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding:
        11px 13px;

    border-radius: 10px;

    background:
        rgba(255,255,255,.035);
}

.odds-name {
    color: var(--muted);

    font-size: 13px;
}

.odds-value {
    font-size: 15px;
    font-weight: 700;
    text-align: right;
}


/* =========================================================
   ANALYSIS TEXT
========================================================= */

.analysis-description {
    color: var(--muted);

    font-size: 14px;

    line-height: 1.75;

    white-space: pre-line;
}


/* =========================================================
   VALUE
========================================================= */

.value-card {
    display: flex;

    gap: 16px;

    padding: 20px;

    margin-bottom: 16px;

    border-radius: 16px;

    border:
        1px solid rgba(0,230,118,.18);

    background:
        linear-gradient(
            135deg,
            rgba(0,230,118,.09),
            rgba(0,230,118,.025)
        );
}

.value-icon {
    width: 48px;
    height: 48px;

    flex:
        0 0 48px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background:
        rgba(0,230,118,.12);

    font-size: 23px;
}

.value-label {
    margin-bottom: 5px;
    color: var(--accent);
    font-size: 10px;
    letter-spacing: 1.5px;
    font-weight: 850;
}

.value-bet {
    font-size: 20px;
    font-weight: 700;
}

.value-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 14px;

    margin-top: 7px;

    color: var(--muted);

    font-size: 12px;
}

.value-reason {
    margin-top: 12px;

    font-size: 14px;

    line-height: 1.65;
}


/* =========================================================
   PREDICTION
========================================================= */

.prediction-card {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding: 22px;

    margin-bottom: 16px;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(0,176,255,.1),
            rgba(0,176,255,.025)
        );

    border:
        1px solid rgba(0,176,255,.15);
}

.prediction-label {
    color: var(--muted);

    font-size: 10px;

    font-weight: 850;

    letter-spacing:
        .12em;

    margin-bottom: 7px;
}

.prediction-text {
    font-size: 19px;
    font-weight: 700;
}

.prediction-side {
    display: flex;

    align-items: center;

    gap: 16px;
}

.confidence {
    text-align: center;
}

.confidence-label {
    color: var(--muted);

    font-size: 11px;
}

.confidence-value {
    margin-top: 2px;

    color: var(--accent);

    font-size: 24px;

    font-weight: 850;
}

.risk-badge {
    padding:
        8px 12px;

    border-radius: 999px;

    background:
        rgba(255,255,255,.06);

    font-size: 11px;

    font-weight: 850;
}


/* =========================================================
   CONCLUSION
========================================================= */

.conclusion-card {
    display: flex;

    gap: 13px;

    padding: 18px;

    border-radius: 14px;

    background:
        rgba(255,255,255,.025);

    border:
        1px solid rgba(255,255,255,.06);
}

.conclusion-icon {
    font-size: 20px;
}

.conclusion-title {
    margin-bottom: 5px;
    letter-spacing: 1.5px;
    font-weight: 800;
}

.conclusion-text {
    color: var(--muted);

    font-size: 14px;

    line-height: 1.65;
}


/* =========================================================
   DISCLAIMER
========================================================= */

.analysis-disclaimer {
    margin-top: 16px;
    color: var(--muted);
    line-height: 1.5;
    font-size: 9px;
    text-align: center;
    opacity: 0.5;
}


/* =========================================================
   FEATURES
========================================================= */

.features {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(250px,1fr)
        );

    gap: 20px;

    margin:
        60px 0;
}

.feature-card {
    padding: 28px;

    background: var(--surface);

    border:
        1px solid rgba(255,255,255,.06);

    border-radius: var(--radius);

    transition:
        .3s;
}

.feature-card:hover {
    transform:
        translateY(-4px);

    border-color:
        rgba(0,230,118,.2);

    box-shadow:
        var(--glow);
}

.feature-card .icon {
    margin-bottom: 12px;

    font-size: 32px;
}

.feature-card h3 {
    margin-bottom: 8px;

    font-size: 16px;
}

.feature-card p {
    color: var(--muted);

    font-size: 14px;
}


/* =========================================================
   HISTORY
========================================================= */

.history {
    margin-top: 40px;
}

.history h2 {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 16px;

    font-size: 22px;
}

.history-list {
    display: flex;

    flex-direction: column;

    gap: 12px;
}

.history-item {
    display: flex;

    align-items: center;

    gap: 16px;

    padding: 16px;

    cursor: pointer;

    background: var(--surface);

    border:
        1px solid rgba(255,255,255,.06);

    border-radius: 12px;

    transition:
        .2s;
}

.history-item:hover {
    border-color:
        var(--accent);

    background:
        var(--surface2);
}

.history-item .info {
    flex: 1;
}

.history-item .time {
    margin-bottom: 3px;

    color: var(--muted);

    font-size: 12px;
}

.history-item .summary {
    font-size: 14px;

    display:
        -webkit-box;

    -webkit-line-clamp: 2;

    -webkit-box-orient: vertical;

    overflow: hidden;
}


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

footer {
    padding: 40px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    opacity: 0.5;
}


/* =========================================================
   TOAST
========================================================= */

.toast {
    position: fixed;

    right: 24px;
    bottom: 24px;

    z-index: 999;

    max-width: 420px;

    padding:
        14px 20px;

    background:
        var(--surface2);

    border:
        1px solid rgba(255,255,255,.1);

    border-radius: 12px;

    font-size: 14px;

    transform:
        translateY(100px);

    opacity: 0;

    transition:
        .3s;
}

.toast.show {
    transform:
        translateY(0);

    opacity: 1;
}

.toast.error {
    color: var(--danger);

    border-color:
        rgba(255,82,82,.4);
}


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

@media (max-width: 700px) {

    nav {
        display: none;
    }

    .hero {
        padding:
            55px 16px 35px;
    }

    .container {
        padding:
            0 14px 60px;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .results-body {
        padding: 14px;
    }

    .results-header {
        padding: 17px;
    }

    .results-header h3 {
        font-size: 17px;
    }

    .analysis-status {
        display: none;
    }

    .analysis-match {
        padding: 16px;
    }

    .match-title {
        font-size: 17px;
    }

    .prediction-card {
        align-items: flex-start;

        flex-direction: column;
    }

    .prediction-side {
        width: 100%;

        justify-content:
            space-between;
    }

    .prediction-text {
        font-size: 17px;
    }

    .value-card {
        padding: 16px;
    }

    .preview-actions {
        flex-direction: column;
    }

    .preview-actions .btn {
        width: 100%;
    }

    .toast {
        right: 14px;
        left: 14px;
        bottom: 14px;
    }
}

/* ===== HISTORY DELETE ===== */

.history-item {
    position: relative;
    padding: 0;
    overflow: hidden;
}

.history-item-content {
    flex: 1;
    min-width: 0;
    padding: 16px;

    display: flex;
    align-items: center;

    cursor: pointer;
}

.history-delete {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255,82,82,.15);
    border-radius: 10px;

    background: rgba(255,82,82,.06);
    color: var(--muted);

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .2s,
        color .2s,
        border-color .2s,
        transform .2s;
}

.history-delete:hover {
    background: rgba(255,82,82,.15);
    border-color: rgba(255,82,82,.35);
    color: var(--danger);

    transform: translateY(-50%) scale(1.05);
}

.history-item .info {
    padding-right: 48px;
}



/* ===== AUTH UI ===== */
.auth-area {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: 16px;
}

.auth-btn {
	border: 1px solid rgba(255,255,255,.1);
	background: rgba(255,255,255,.04);
	color: var(--text);
	border-radius: 50%;
    width: 39px;
    height: 39px;
	font-weight: 700;
	cursor: pointer;
}

.auth-btn:hover {
	border-color: rgba(0,230,118,.35);
	background: rgba(0,230,118,.06);
}

.auth-user {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.auth-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--surface2);
	border: 1px solid rgba(255,255,255,.1);
}

.auth-name {
	font-size: 13px;
	font-weight: 700;
	max-width: 150px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
	transition: 0.3s;
}
.auth-name:hover {
    color: #00e676;
}

.auth-modal {
	position: fixed;
	inset: 0;
	z-index: 990;
	background: rgba(0,0,0,.68);
	backdrop-filter: blur(12px);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.auth-modal.active {
	display: flex;
}

.auth-box {
	width: min(440px,100%);
	background: var(--surface);
	border: 1px solid rgba(255,255,255,.09);
	border-radius: 22px;
	box-shadow: 0 30px 100px rgba(0,0,0,.45);
	padding: 26px;
	position: relative;
}

.auth-close {
	position: absolute;
	right: 15px;
	top: 0;
	border: 0;
	background: transparent;
	color: var(--muted);
	font-size: 45px;
	cursor: pointer;
}

.auth-box h2 {
	font-size: 24px;
	margin-bottom: 7px;
}

.auth-sub {
	color: var(--muted);
	font-size: 13px;
	margin-bottom: 20px;
}

.auth-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 7px;
	margin-bottom: 16px;
	font-size: 15px;
	background: rgba(255,255,255,.03);
	padding: 4px;
	border-radius: 12px;
}

.auth-tab {
	border: 0;
	background: transparent;
	color: var(--muted);
	padding: 10px;
	border-radius: 9px;
	font-weight: 700;
	cursor: pointer;
}

.auth-tab.active {
	background: var(--surface2);
	color: var(--text);
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.auth-form input {
	width: 100%;
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--text);
    border-radius: 11px;
    font-size: 16px;
    padding: 12px 13px;
    outline: none;
}

.auth-form input:focus {
	border-color: var(--accent);
}

.auth-submit {
	border: 0;
    border-radius: 11px;
    padding: 13px;
    background: linear-gradient(135deg, var(--accent), #00c853);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    color: #000;
    margin-top: 4px;
}

.auth-socials {
	display: grid;
	grid-template-columns: 1fr;
	gap: 9px;
	margin-top: 15px;
}

.auth-social {
	border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .035);
    color: var(--text);
    display: flex;
    border-radius: 11px;
    padding: 11px;
    gap: 7px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.auth-social img {
    border-radius: 50%;
}

.auth-social:hover {
	background: rgba(255,255,255,.07);
}

.auth-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--muted);
	font-size: 11px;
	margin: 16px 0;
}

.auth-divider:before,.auth-divider:after {
	content: "";
	height: 1px;
	background: rgba(255,255,255,.08);
	flex: 1;
}

.auth-profile {
	display: none;
	align-items: center;
	gap: 10px;
}

.auth-profile.active {
	display: flex;
}

.auth-profile-menu {
	position: fixed;
	right: 24px;
	top: 72px;
	width: 240px;
	background: var(--surface);
	border: 1px solid rgba(255,255,255,.09);
	border-radius: 15px;
	padding: 8px;
	box-shadow: 0 20px 60px rgba(0,0,0,.35);
	display: none;
	z-index: 500;
}

.auth-profile-menu.active {
	display: block;
}

.auth-menu-btn {
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	color: var(--text);
	padding: 11px 12px;
	border-radius: 9px;
	cursor: pointer;
}

.auth-menu-btn:hover {
	background: rgba(255,255,255,.06);
}

.auth-menu-btn.danger {
	color: var(--danger);
}

@media(max-width:700px) {
	.auth-name {
		display: none;
	}

	.auth-area {
		margin-left: 6px;
	}

	.auth-socials {
		grid-template-columns: 1fr;
	}

	.auth-profile-menu {
		right: 12px;
		top: 65px;
	}
}