/* =========================================================
   RESULTS PAGE
   Stock Insights NSE
   ========================================================= */

.results-page {
    width: 100%;
    min-height: 100vh;
    background: #f8fafc;
    color: #0f172a;
}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.results-container {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 60px;
}


/* =========================================================
   PAGE TITLE
   ========================================================= */

.results-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
    color: #07152d;
}

.results-description {
    margin: 10px 0 24px;
    max-width: 760px;
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
}


/* =========================================================
   FILTER AREA
   ========================================================= */

.results-filter {
    position: relative;
    width: 100%;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}


/* Search + quarter in one row */

.results-filter-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}


/* =========================================================
   SEARCH BOX
   ========================================================= */

.results-search-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.results-search {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 50px;

    border: 1px solid #d6deea;
    border-radius: 14px;

    background: #f8fafc;

    color: #0f172a;
    font-size: 16px;

    outline: none;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.results-search::placeholder {
    color: #94a3b8;
}

.results-search:focus {
    background: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .10);
}


/* Search icon */

.results-search-icon {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);

    width: 22px;
    height: 22px;

    color: #64748b;

    pointer-events: none;
}


/* Clear */

.results-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    background: transparent;

    color: #64748b;

    cursor: pointer;
    font-size: 20px;
}

.results-search-clear:hover {
    color: #7c3aed;
}


/* =========================================================
   AUTOSUGGEST
   ========================================================= */

.results-suggestions {
    position: absolute;

    top: calc(100% + 6px);
    left: 0;
    right: 0;

    z-index: 1000;

    background: #ffffff;

    border: 1px solid #dbe3ee;
    border-radius: 14px;

    box-shadow:
        0 15px 35px rgba(15, 23, 42, .12);

    overflow: hidden;
}

.results-suggestion-item {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 13px 16px;

    border: 0;
    border-bottom: 1px solid #eef2f7;

    background: #ffffff;

    text-align: left;

    cursor: pointer;
}

.results-suggestion-item:last-child {
    border-bottom: 0;
}

.results-suggestion-item:hover {
    background: #f8f5ff;
}

.results-suggestion-company {
    font-weight: 700;
    color: #0f172a;
}

.results-suggestion-symbol {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}


/* =========================================================
   QUARTER SELECT
   ========================================================= */

.results-quarter-wrapper {
    flex: 0 0 190px;
}

.results-quarter {
    width: 100%;
    height: 52px;

    padding: 0 14px;

    border: 1px solid #d6deea;
    border-radius: 14px;

    background: #ffffff;

    color: #334155;

    font-size: 15px;

    outline: none;

    cursor: pointer;
}

.results-quarter:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .10);
}


/* =========================================================
   SORT BUTTONS
   ========================================================= */

.results-sort {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.results-sort-button {
    min-width: 120px;
    height: 44px;

    padding: 0 22px;

    border: 1px solid #cbd5e1;
    border-radius: 12px;

    background: #ffffff;

    color: #0f172a;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .15s ease;
}

.results-sort-button:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}


/* IMPORTANT: selected button */

.results-sort-button.active {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #6d28d9;
}

.results-sort-button.active:hover {
    background: #e9d5ff;
}


/* =========================================================
   RESULTS HEADER
   ========================================================= */

.results-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;
}

.results-list-title {
    margin: 0;

    font-size: 20px;
    font-weight: 800;

    color: #07152d;
}

.results-count {
    font-size: 14px;
    color: #64748b;
}


/* =========================================================
   RESULT CARD
   ========================================================= */

.result-card {
    position: relative;

    width: 100%;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 18px;

    padding: 22px 24px;

    margin-bottom: 16px;

    box-shadow:
        0 3px 12px rgba(15, 23, 42, .045);

    transition:
        box-shadow .2s ease,
        transform .2s ease,
        border-color .2s ease;
}

.result-card:hover {
    transform: translateY(-1px);

    border-color: #d8c9f7;

    box-shadow:
        0 8px 25px rgba(15, 23, 42, .07);
}


/* =========================================================
   CARD TOP
   ========================================================= */

.result-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.result-company {
    margin: 0;

    font-size: 18px;
    line-height: 1.35;

    font-weight: 800;

    color: #0f172a;
}

.result-symbol {
    margin-top: 4px;

    font-size: 14px;

    color: #64748b;
    font-weight: 500;
}


/* =========================================================
   QUARTER BADGE
   ========================================================= */

.result-quarter {
    flex-shrink: 0;

    padding: 9px 14px;

    border-radius: 999px;

    background: #f8fafc;

    color: #64748b;

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
}


/* =========================================================
   METRICS
   ========================================================= */

.result-metrics {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 24px;
}


/* Individual metric */

.result-metric {
    min-width: 0;
}

.result-metric-label {
    margin-bottom: 5px;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: .04em;

    color: #64748b;

    text-transform: uppercase;
}

.result-metric-value {
    font-size: 19px;
    line-height: 1.3;

    font-weight: 800;

    color: #0f172a;
}

.result-metric-unit {
    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   CHANGE VALUES
   ========================================================= */

.result-change {
    margin-top: 7px;

    font-size: 13px;
    font-weight: 600;

    line-height: 1.4;
}

.result-change.positive {
    color: #16a34a;
}

.result-change.negative {
    color: #dc2626;
}

.result-change.neutral {
    color: #64748b;
}


/* =========================================================
   AI BUTTON
   ========================================================= */

.result-card-bottom {
    display: flex;
    justify-content: center;

    margin-top: 20px;
}

.result-ai-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 160px;
    height: 42px;

    padding: 0 20px;

    border-radius: 999px;

    background: linear-gradient(
        135deg,
        #7c3aed,
        #9333ea
    );

    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    text-decoration: none;

    box-shadow:
        0 5px 14px rgba(124, 58, 237, .20);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.result-ai-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 8px 18px rgba(124, 58, 237, .28);
}


/* =========================================================
   PAGINATION
   ========================================================= */

.results-pagination {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 6px;

    margin-top: 28px;
}

.results-pagination a,
.results-pagination span {
    min-width: 36px;
    height: 36px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 0 10px;

    border: 1px solid #dbe3ee;
    border-radius: 9px;

    background: #ffffff;

    color: #334155;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;
}

.results-pagination a:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

.results-pagination .active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #ffffff;
}

/* =========================================================
   STOCK AUTOCOMPLETE
   ========================================================= */

.stock-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}


.stock-search-box {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 0 14px;

    background: #ffffff;

    border: 1px solid #d8deea;

    border-radius: 14px;
}


.search-icon {
    font-size: 20px;
    color: #64748b;
    line-height: 1;
}


.stock-search-box input {
    flex: 1;

    width: 100%;

    border: 0;
    outline: none;

    background: transparent;

    font-size: 14px;

    color: #0f172a;
}


.stock-search-box input::placeholder {
    color: #94a3b8;
}


.clear-search {
    width: 25px;
    height: 25px;

    border: 0;

    border-radius: 50%;

    background: transparent;

    color: #64748b;

    cursor: pointer;

    font-size: 20px;

    line-height: 20px;
}


.clear-search:hover {
    background: #f1f5f9;
}


/* =========================================================
   AUTOCOMPLETE DROPDOWN
   ========================================================= */

.stock-suggestions {
    position: absolute;

    top: calc(100% + 6px);

    left: 0;
    right: 0;

    z-index: 1000;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 14px;

    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.12);

    overflow: hidden;
}


.stock-suggestions.hidden {
    display: none;
}


.stock-suggestion {
    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding: 13px 16px;

    border: 0;

    border-bottom: 1px solid #f1f5f9;

    background: #ffffff;

    text-align: left;

    cursor: pointer;
}


.stock-suggestion:last-child {
    border-bottom: 0;
}


.stock-suggestion:hover {
    background: #f8f7ff;
}


.suggestion-company {
    font-size: 14px;

    font-weight: 600;

    color: #0f172a;
}


.suggestion-symbol {
    flex-shrink: 0;

    font-size: 12px;

    font-weight: 600;

    color: #64748b;
}


/* =========================================================
   FILTER ROW
   ========================================================= */

.filter-row {
    display: flex;

    align-items: center;

    gap: 12px;
}


.quarter-filter {
    flex: 0 0 145px;
}


.quarter-filter select {
    width: 100%;

    height: 46px;

    padding: 0 12px;

    border: 1px solid #d8deea;

    border-radius: 14px;

    background: #ffffff;

    color: #334155;

    font-size: 13px;

    outline: none;

    cursor: pointer;
}


.quarter-filter select:focus,
.stock-search-box:focus-within {
    border-color: #7c3aed;

    box-shadow:
        0 0 0 3px rgba(124, 58, 237, 0.08);
}


/* =========================================================
   SORT BUTTONS
   ========================================================= */

.sort-buttons {
    display: flex;

    gap: 10px;

    margin-top: 12px;

    margin-bottom: 20px;
}


.sort-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 105px;

    height: 40px;

    padding: 0 17px;

    border: 1px solid #cbd5e1;

    border-radius: 12px;

    background: #ffffff;

    color: #0f172a;

    font-size: 13px;

    font-weight: 600;

    text-decoration: none;

    transition:
        background .2s ease,
        border-color .2s ease,
        color .2s ease;
}


.sort-button:hover {
    border-color: #7c3aed;

    color: #6d28d9;
}


.sort-button.active {
    background: #ede9fe;

    border-color: #c4b5fd;

    color: #5b21b6;
}


/* =========================================================
   RESULTS LIST
   ========================================================= */

.results-list {
    display: flex;

    flex-direction: column;

    gap: 18px;
}


/* =========================================================
   RESULT CARD
   ========================================================= */

.result-card {
    position: relative;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 18px;

    padding: 22px 24px;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.04);
}


.result-card-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}


.result-card-header h3 {
    margin: 0;

    color: #0f172a;

    font-size: 17px;

    font-weight: 700;
}


.result-symbol {
    margin-top: 5px;

    color: #64748b;

    font-size: 13px;
}


.result-quarter {
    flex-shrink: 0;

    padding: 8px 13px;

    border-radius: 999px;

    background: #f8fafc;

    color: #64748b;

    font-size: 12px;

    font-weight: 600;
}


/* =========================================================
   METRICS
   ========================================================= */

.result-metrics {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 25px;
}


.metric-label {
    margin-bottom: 7px;

    color: #64748b;

    font-size: 11px;

    font-weight: 600;

    letter-spacing: .03em;
}


.metric-value {
    color: #0f172a;

    font-size: 17px;

    font-weight: 700;
}


.metric-value span {
    font-size: 11px;

    font-weight: 500;

    color: #64748b;
}


.metric-change {
    margin-top: 7px;

    font-size: 11px;

    font-weight: 500;
}


.metric-change.positive {
    color: #16a34a;
}


.metric-change.negative {
    color: #dc2626;
}


/* =========================================================
   AI BUTTON
   ========================================================= */

.result-action {
    display: flex;

    justify-content: center;

    margin-top: 18px;
}


.ai-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 100px;

    height: 32px;

    padding: 0 16px;

    border: 0;

    border-radius: 999px;

    background: #7c3aed;

    color: #ffffff;

    font-size: 11px;

    font-weight: 600;

    text-decoration: none;

    box-shadow:
        0 4px 10px rgba(124, 58, 237, 0.20);
}


.ai-button:disabled {
    opacity: .6;

    cursor: not-allowed;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;

    align-items: center;

    justify-content: center;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 28px;

    margin-bottom: 10px;
}


.page-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 34px;

    height: 34px;

    padding: 0 10px;

    border: 1px solid #d8deea;

    border-radius: 9px;

    background: #ffffff;

    color: #334155;

    font-size: 12px;

    font-weight: 600;

    text-decoration: none;
}


.page-button:hover {
    border-color: #7c3aed;

    color: #6d28d9;
}


.page-button.active {
    background: #7c3aed;

    border-color: #7c3aed;

    color: #ffffff;
}


.page-dots {
    padding: 0 3px;

    color: #94a3b8;

    font-size: 12px;
}


/* =========================================================
   NO RESULTS
   ========================================================= */

.no-results {
    padding: 50px 20px;

    text-align: center;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 18px;
}


.no-results h3 {
    margin: 0 0 7px;

    color: #0f172a;
}


.no-results p {
    margin: 0;

    color: #64748b;

    font-size: 13px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {

    .filter-row {
        flex-direction: row;

        align-items: center;
    }


    .quarter-filter {
        flex: 0 0 115px;
    }


    .result-card {
        padding: 18px;
    }


    .result-card-header {
        margin-bottom: 18px;
    }


    .result-card-header h3 {
        font-size: 15px;
    }


    .result-metrics {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 10px;
    }


    .metric-value {
        font-size: 14px;
    }


    .metric-change {
        font-size: 10px;
    }


    .sort-button {
        min-width: auto;

        flex: 1;

        padding: 0 10px;

        font-size: 12px;
    }

}
/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .results-container {
        width: min(100% - 28px, 760px);
    }

    .results-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .results-quarter-wrapper {
        flex: 1 1 auto;
    }

    .result-metrics {
        gap: 18px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {

    .results-container {
        width: calc(100% - 24px);
        padding-top: 20px;
        padding-bottom: 40px;
    }

    .results-title {
        font-size: 24px;
    }

    .results-description {
        font-size: 14px;
    }

    .results-filter {
        padding: 12px;
        border-radius: 16px;
    }

    .results-search {
        height: 50px;
        font-size: 15px;
    }

    .results-quarter {
        height: 50px;
    }

    .results-sort {
        gap: 8px;
    }

    .results-sort-button {
        flex: 1;
        min-width: 0;

        padding: 0 10px;

        font-size: 13px;
    }

    .result-card {
        padding: 18px;
        border-radius: 16px;
        margin-bottom: 14px;
    }

    .result-card-top {
        margin-bottom: 18px;
    }

    .result-company {
        font-size: 17px;
    }

    .result-quarter {
        font-size: 12px;
        padding: 7px 10px;
    }

    .result-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 18px 14px;
    }

    .result-metric-value {
        font-size: 17px;
    }

    .result-card-bottom {
        margin-top: 18px;
    }

    .result-ai-button {
        min-width: 145px;
        height: 40px;
        font-size: 13px;
    }
}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 400px) {

    .result-card-top {
        gap: 10px;
    }

    .result-company {
        font-size: 16px;
    }

    .result-quarter {
        font-size: 11px;
    }

    .result-metrics {
        grid-template-columns: 1fr;
    }
}