/* ==========================================
   Politician Card
========================================== */

.politician-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.politician-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;

    box-shadow:
        0 8px 24px rgba(0,0,0,.08);

    border:1px solid transparent;

    transition:
        transform .3s ease,
        box-shadow all .3s ease;

    display: flex;
    flex-direction: column;
    position:relative;
}

.politician-card:hover {
    border:3px solid #0F766E;

    transform:translateY(-6px);

    box-shadow:0 16px 36px rgba(15,118,110,.12);
}

/* ==========================================
   Image
========================================== */

.card-image {
    width: 100%;
    height: 300px;

    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .4s ease;
}

.politician-card:hover img {
    transform: scale(1.05);
}

/* ==========================================
   Card Body
========================================== */

.card-body {
    padding: 1.5rem;

    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ==========================================
   Name
========================================== */

.card-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
}

/* ==========================================
   Position
========================================== */

.card-position{
    display:flex;
    align-items:center;
    gap:8px;
    color:#00A86B;
    font-weight:600;
    font-size:.95rem;
    flex-wrap:wrap;
}

.reelected-badge{
    background:#ECFDF5;
    color:#047857;
    border:1px solid #A7F3D0;
    border-radius:999px;
    padding:3px 10px;
    font-size:.75rem;
    font-weight:700;
    line-height:1;
}

.card-position-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:8px;
}

.card-position{
    margin:0;
}

.reelected-badge{
    margin-left:auto;
}

.elected-years{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:-6px;
    font-size:.82rem;
    color:#6B7280;
    font-weight:500;
    flex-wrap:wrap;
    line-height:1.5;
}

.elected-years i{
    color:#0F766E;
    font-size:.9rem;
    flex-shrink:0;
}

.year-chip{
    background:#F3F4F6;
    color:#374151;
    border:1px solid #E5E7EB;
    border-radius:999px;
    padding:4px 10px;
    font-size:.75rem;
    font-weight:600;
    transition:.2s ease;
}

.year-chip:hover{
    background:#ECFDF5;
    border-color:#0F766E;
    color:#0F766E;
}

/* ==========================================
   Party Badge
========================================== */

.party-badge {
    width: fit-content;

    background: #00A86B;

    color: white;

    padding: .45rem 1rem;

    border-radius: 100px;

    font-size: .85rem;

    font-weight: 600;
}

/* ==========================
   Poll Section
========================== */

.poll-section{
    margin:20px 0;
    padding:16px;
    background:#F8FAFC;
    border:1px solid #E5E7EB;
    border-radius:14px;
}

.poll-title{
    font-size:0.95rem;
    font-weight:600;
    color:#111827;
    margin-bottom:14px;
    text-align:center;
}

.poll-buttons{
    display:flex;
    gap:12px;
    margin-bottom:14px;
}

.vote-btn{
    flex:1;
    padding:12px;
    border:none;
    border-radius:10px;
    cursor:pointer;
    font-weight:600;
    font-size:.9rem;
    transition:.25s;
}

.vote-yes{
    background:#DCFCE7;
    color:#166534;
}

.vote-no{
    background:#FEE2E2;
    color:#991B1B;
}

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

/* ==========================================
   Information
========================================== */

.card-info {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    border-bottom: 1px solid #ececec;

    padding-bottom: .6rem;
}

.info-title {
    font-weight: 600;
    color: #666;
}

.info-value {
    text-align: right;
    color: #222;
}

.assets-preview{
    display:inline-flex;
    align-items:center;
    gap:6px;

    width:fit-content;

    margin-top:4px;
    padding:6px 12px;

    background:#ECFDF5;
    color:#047857;

    border:1px solid #A7F3D0;
    border-radius:999px;

    font-size:.82rem;
    font-weight:700;
}

.card-ministry{
    margin:0 0 0px;

    font-size:.95rem;      /* Same size as MLA */
    font-weight:600;       /* Same weight as MLA */

    color:#00A86B;         /* Same green as your website */
}

.family-icon{
    margin-left:8px;
    font-size:.9rem;
    color:#00A86B;
    vertical-align:middle;
}

/* ==========================================
   Education Box
========================================== */

.education-box{

    background:#F5F8FB;

    border-radius:12px;

    padding:1rem;

}

.degree{

    display:block;

    font-size:1rem;

    font-weight:700;

    color:#111;

}

.card-description{

    margin-top:14px;

    color:#6B7280;

    font-size:.92rem;

    line-height:1.6;

}

.education-box{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.education-label{
    font-size:.9rem;
    font-weight:600;
    color:#6B7280;
}

.degree{
    font-size:1rem;
    font-weight:700;
    color:#111827;
    text-align:right;
}

/* ==========================================
   Tagline
========================================== */

.card-tagline{

    margin-top: .5rem;

    color: #555;

    font-size: .95rem;

    line-height: 1.5;

    font-style: italic;
}

/* ==========================================
   Footer
========================================== */

.card-footer {

    margin-top: auto;

    padding-top: 1rem;

    display: flex;

    justify-content: space-between;

    align-items: center;
}

.state {

    font-size: .9rem;

    color: #666;
}

.view-profile {

    text-decoration: none;

    color: #00A86B;

    font-weight: 600;

    transition: .3s;
}

.view-profile:hover {

    color: #008d5a;
}

.assets-box{
    margin-top:18px;
    padding:14px 16px;
    background:#F8FAFC;
    border:1px solid #E5E7EB;
    border-radius:14px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    transition:all .25s ease;
}

.assets-box:hover{
    border-color:#0F766E;
    box-shadow:0 6px 18px rgba(15,118,110,.12);
    transform:translateY(-2px);
}

.assets-label{
    font-size:0.9rem;
    color:#4f5156;
    font-weight:500;
}

.assets-value{
    font-size:1rem;
    font-weight:700;
    color:#0F766E;
}

.card-overlay{
    position:fixed;
    inset:0;
    padding:40px 0;              /* Space at top and bottom */
    background:rgba(0,0,0,.45);
    backdrop-filter:blur(8px);
    display:flex;
    justify-content:center;
    align-items:center;
    opacity:0;
    visibility:hidden;
    transition:.3s;
    z-index:9999;
    overflow-y:auto;             /* Scroll if card becomes tall */
    box-sizing:border-box;
}

.card-overlay.active{
    opacity:1;
    visibility:visible;
}

#expandedCard .politician-card{
    position:fixed;
    top:0;
    left:0;
    width:100vw;
    height:100vh;
    margin:0;
    border-radius:0;
    background:#fff;
    overflow-y:auto;
    z-index:10000;
}

.card-overlay.active #expandedCard .politician-card{
    transform:scale(1);
}

.close-card{
    position:fixed;
    top:16px;
    left:16px;

    width:44px;
    height:44px;

    border:none;
    border-radius:50%;

    background:rgba(0,0,0,.55);
    color:#fff;

    font-size:20px;
    cursor:pointer;

    z-index:10001;
}

.close-card:hover{
    transform:scale(1.08);
    background:#F3F4F6;
}

.card-badges{
    display:flex;
    align-items:center;
    gap:8px;
}

.party-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    width:100%;
}

.wealth-rank{
    margin-left:10px;
    font-size:.9rem;
    font-weight:600;
    color:#0F766E;
}

.hidden{
    display:none;
}

.poll-bar{
    display:flex;
    width:100%;
    height:10px;
    border-radius:999px;
    overflow:hidden;
    background:#E5E7EB;
}

.poll-anonymous{
    display:flex;
    justify-content:center;
    align-items:center;

    margin:10px 0 0;

    font-size:.82rem;
    color:#6B7280;

    text-align:center;
}

.poll-bar-yes{
    width:0%;
    background:#16A34A;
    transition:width .5s ease;
}

.poll-bar-no{
    width:0%;
    background:#DC2626;
    transition:width .5s ease;
}

.poll-percentages{
    display:flex;
    justify-content:space-between;
    margin-bottom:8px;
    font-weight:700;
}

.poll-stats{
    display:flex;
    justify-content:space-between;
    color:#6B7280;
    font-size:.9rem;
}

.change-vote-btn{
    margin-top:2px;
    width:100%;
    background:none;
    border:none;
    color:#0F766E;
    font-weight:600;
    cursor:pointer;
    padding:6px 8px;
}

.change-vote-btn:hover{
    text-decoration:underline;
}

/* ==========================================
   Mobile
========================================== */

@media (max-width:768px){

    .politician-grid{

        grid-template-columns:1fr;

        gap:18px;

        padding:0 16px;
    }

    .politician-card{
        min-height: auto;
        border-radius: 18px;
    }

    .card-image{
        height: 400px;
    }

    .card-body{
        padding: 16px;
        gap: 10px;
    }

    .card-name{
        font-size: 1.2rem;
        line-height: 1.35;
        margin: 0;
    }

    .card-position{
        font-size: .9rem;
        margin: 0;
    }

    .party-badge{
        align-self: flex-start;
        font-size: .8rem;
        padding: 6px 14px;
    }

    .info-row{

        padding:.75rem 0;
    }

    .assets-box{

        margin-top:14px;

        padding:12px 14px;
    }
    .card-overlay{

    align-items:flex-end;

    padding:0;

    backdrop-filter:blur(4px);
    }

    #expandedCard{
        position:fixed;
        inset:0;
        width:100vw;
        height:100vh;
    }

    #expandedCard .politician-card{

        position:fixed;

        inset:0;

        width:100%;
        height:100%;

        margin:0;

        border-radius:0;

        overflow-y:auto;

        overscroll-behavior:contain;

        background:#fff;

        display:flex;
        flex-direction:column;

        transform:translateY(100%);
        transition:transform .35s ease;
    }

    #expandedCard .card-position-row {
        margin-bottom: 15px;
    }

    #expandedCard .election-years {
        margin-bottom: 15px;
    }

    #expandedCard .party-row {
        margin-top: 10px;
    }

    .card-overlay.active #expandedCard .politician-card{

        transform:translateY(0);
    }

    .close-card{

        top:14px;

        right:16px;

        width:40px;

        height:40px;

        font-size:24px;
    }

    .sheet-handle{

        width:48px;

        height:5px;

        background:#D1D5DB;

        border-radius:999px;

        margin:12px auto 6px;
    }
    .politician-card{
        height: auto;
        min-height: auto;
    }

    #expandedCard .card-image{
        height:25vh;
        min-height:280px;
    }

    #expandedCard .card-body{
        padding:12px 16px;
        gap:8px;
    }

    .politician-grid .politician-card .card-image{
        height:400px;
    }

    .card-body{
        padding: 20px;
    }

    main{
        gap:24px;
    }

    .search-section{
        margin-top:12px;
    }

    .back-map-container{
        margin-top:12px;
        padding:0 16px;
    }

    #politicians{
        width:100%;
    }

    footer{
        padding:24px 16px;
    }

}

.data-note {
    width: 100%;
    margin: 12px 0 0;
    padding-top: 10px;

    border-top: 1px solid #e5e7eb;

    font-size: 10px;
    line-height: 1.5;
    font-style: italic;
    color: #6b7280;
    text-align: center;

    box-sizing: border-box;
}