:root{

    --primary:#005aa7;
    --primary-dark:#003d73;

    --bg:#f5f7fb;
    --card:#ffffff;

    --text:#2d3748;
    --text-muted:#555;

    --border:#eceff3;

    --surface:#f5f7fb;

    --shadow:
        0 4px 16px rgba(0,0,0,.08);

    --shadow-hover:
        0 10px 25px rgba(0,0,0,.12);

    --badge-bg:#e7f1ff;
    --badge-text:#005aa7;

    --error-bg:#fff4f4;
    --error-border:#ffb3b3;
    --error-text:#a10000;
}

/* ======================
   DARK MODE
====================== */

[data-theme="dark"]{

    --primary:#2b8cff;
    --primary-dark:#0d6efd;

    --bg:#0f172a;

    --card:#1e293b;

    --surface:#334155;

    --text:#f8fafc;

    --text-muted:#cbd5e1;

    --border:#475569;

    --shadow:
        0 4px 16px rgba(0,0,0,.40);

    --shadow-hover:
        0 10px 25px rgba(0,0,0,.55);

    --badge-bg:#1d4ed8;
    --badge-text:#ffffff;

    --error-bg:#3b0d0d;
    --error-border:#991b1b;
    --error-text:#fecaca;
}


[data-theme="dark"] #clearAllFavorites:hover{

    background:#ef4444;
}

/* ======================
   DARK MODE OVERRIDES
====================== */



[data-theme="dark"] .card:hover{

    border-color:var(--primary);

    box-shadow:var(--shadow-hover);
}



[data-theme="dark"] .filters input::placeholder{
    color:var(--text-muted);
}

[data-theme="dark"] .subjekt-filter label{

    background:var(--card);

    color:var(--text);

    border:1px solid var(--border);
}




[data-theme="dark"] .error-box{

    background:var(--error-bg);

    border-color:var(--error-border);

    color:var(--error-text);
}

[data-theme="dark"] .active-filters .filter-tag{

    background:var(--primary);

    color:white;
}

[data-theme="dark"] .filter-tag button{
    color:white;
}



*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:"Segoe UI", Arial, sans-serif;
}

body{
    background:var(--bg);
    color:var(--text);
}

/* ======================
   NAVIGATION
====================== */

.navbar{
    background:var(--primary-dark);
    color:white;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px 25px;
    position:sticky;
    top:0;
    z-index:1000;
}

.logo{
    font-size:20px;
    font-weight:700;
}

.menu-toggle{
    display:none;
    background:none;
    border:none;
    color:white;
    font-size:28px;
    cursor:pointer;
	z-index:2001;
}

.nav-links{
    display:flex;
    list-style:none;
    gap:25px;
	z-index:2000;
}

.nav-links a{
    color:white;
    text-decoration:none;
    transition:.2s;
}

.nav-links a:hover{
    color:#FFD54F;
}

.nav-links a.active{
    color:#FFD54F;
    font-weight:700;
}

/* ======================
   HERO
====================== */

.hero{
    background:linear-gradient(
        135deg,
        var(--primary),
		var(--primary-dark)
    );

    color:white;
    text-align:center;
    padding:70px 20px;
}

.hero h1{
    margin-bottom:15px;
}

.hero p{
    max-width:800px;
    margin:auto;
    line-height:1.6;
}

/* ======================
   CONTAINER
====================== */

.container{
    max-width:1200px;
    margin:auto;
    padding:40px 20px;
}

/* ======================
   FILTERS
====================== */

.filters{
    display:grid;
    grid-template-columns:
        1fr
        220px
        180px
        180px;
    gap:15px;
    margin-bottom:25px;
}

.filters input,
.filters select{

    padding:14px;

    border:1px solid var(--border);

    border-radius:10px;

    background:var(--card);

    color:var(--text);

    box-shadow:
        0 3px 10px rgba(0,0,0,.08);

    font-size:15px;
}

.filters button{

    border:none;
    border-radius:10px;

    background:var(--primary);

    color:white;

    cursor:pointer;

    padding:14px;
}

.filters button:hover{
    background:var(--primary-dark);
}

/* ======================
   ACTIVE FILTERS
====================== */

.active-filters{

    display:flex;
    flex-wrap:wrap;
    gap:8px;

    margin-bottom:20px;
}

.filter-tag{

    display:flex;
    align-items:center;
    gap:6px;

    background:var(--primary);
    color:white;

    padding:6px 12px;

    border-radius:20px;

    font-size:14px;
}

.filter-tag button{

    border:none;
    background:none;

    color:white;

    cursor:pointer;

    font-size:16px;
    line-height:1;
}

/* ======================
   SUBJECT FILTER
====================== */

.subjekt-filter{

    display:flex;
    flex-wrap:wrap;
    gap:10px;

    margin-bottom:20px;
}

.subjekt-filter label{

    display:flex;
    align-items:center;
    gap:6px;

    background:var(--card);

    padding:8px 12px;

    border-radius:8px;

    box-shadow:
        0 2px 6px rgba(0,0,0,.05);
}

/* ======================
   PAGE INFO
====================== */

.page-info{

    text-align:center;

    margin-bottom:20px;

    color:var(--text-muted);
}

/* ======================
   GRID
====================== */

.grid{

    display:grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(320px,1fr)
        );

    gap:25px;

    align-items:stretch;
}

/* ======================
   CARD
====================== */

.card{

    background:var(--card);

    border-radius:18px;

    overflow:hidden;

    border:1px solid var(--border);

    box-shadow:var(--shadow);

    transition:
        transform .2s ease,
        box-shadow .2s ease;

    display:flex;

    min-height:340px;

    height:100%;
}

.card:hover{

    transform:translateY(-4px);

    box-shadow:var(--shadow-hover);
}

.card-content{

    display:flex;

    flex-direction:column;

    justify-content:flex-start;

    width:100%;
    height:100%;

    padding:20px;
}

/* ======================
   CARD HEADER
====================== */

.card-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    min-height:34px;

    margin-bottom:15px;
}

.card-obvod{

    background:var(--badge-bg);

    color:var(--badge-text);

    padding:4px 10px;

    border-radius:999px;

    font-size:13px;

    font-weight:600;
}

.card-number{

    color:var(--text-muted);

    font-size:13px;
}

/* ======================
   CARD ACTIONS
====================== */

.card-actions{

    display:flex;

    gap:10px;

    margin-top:15px;
}

.favorite-btn{

    width:56px;

    min-width:56px;

    border:none;

    background:none;

    color:#999;

    cursor:pointer;

    font-size:24px;
}

.favorite-btn:hover{

    background:none;

    color:#ffc107;

    transform:scale(1.1);
}

.favorite-btn.active{

    background:none;

    color:#ffc107;

    transform:scale(1.15);

    animation:
        favoritePulse .35s ease;
}

.detail-btn{

    flex:1;
}

@keyframes favoritePulse{

    0%{
        transform:scale(1);
    }

    50%{
        transform:scale(1.35);
    }

    100%{
        transform:scale(1.15);
    }
}

.card.selected{

    box-shadow:
        0 0 0 2px rgba(255,193,7,.15),
        var(--shadow);
}

/* ======================
   CANDIDATE
====================== */

.candidate-name{

    display:flex;

    align-items:flex-start;

    min-height:60px;

    font-size:20px;

    line-height:1.3;

    font-weight:600;

    color:var(--text);

    margin-bottom:10px;
}

.candidate-info{

    display:flex;

    flex-direction:column;

    gap:6px;

    min-height:80px;

    font-size:14px;

    color:var(--text-muted);

    margin-bottom:15px;
}

.party{

    display:flex;

    align-items:center;

    min-height:90px;

    padding:10px;

    border-radius:10px;

    background:var(--surface);

    color:var(--text);

    font-size:13px;

    word-break:break-word;

    margin-bottom:15px;
}

.badge{

    display:inline-block;

    background:var(--badge-bg);

    color:var(--badge-text);

    border-radius:15px;

    padding:6px 12px;

    margin-bottom:15px;

    font-size:.85rem;
}

.candidate-header{

    display:flex;

    justify-content:space-between;

    align-items:flex-start;

    gap:10px;

    margin-bottom:10px;
}

.candidate-header h2{

    margin:0;

    flex:1;
}

/* ======================
   BUTTONS
====================== */

.detail-btn{

    width:100%;

    margin-top:auto;

    border:none;

    background:var(--primary);

    color:white;

    padding:12px;

    border-radius:10px;

    cursor:pointer;

    font-weight:600;
}

.card-actions{

    display:flex;

    gap:10px;

    margin-top:15px;
}

.favorite-btn{

    width:56px;

    border:none;

    border-radius:10px;

    cursor:pointer;

    font-size:18px;

    background:#f1f5f9;
}

.favorite-btn:hover{

    transform:scale(1.1);

    background:none;

    color:#ffc107;
}

.favorite-btn.active{

    background:#ffc107;

    color:#000;

    font-weight:700;

    box-shadow:
        0 0 0 3px rgba(255,193,7,.35);
}

.detail-btn:hover{
    background:var(--primary-dark);
}

.remove-favorite-btn{

    background:#dc3545;

    color:white;

    border:none;

    border-radius:10px;

    padding:12px;

    cursor:pointer;

    min-width:120px;
}

.remove-favorite-btn:hover{

    background:#b02a37;
}

/* ======================
   PAGINATION
====================== */

.pagination{

    display:flex;

    justify-content:center;

    align-items:center;

    flex-wrap:wrap;

    gap:8px;

    margin-top:40px;
}

.pagination button{

    min-width:42px;

    border:1px solid var(--border);

    padding:10px 14px;

    background:var(--card);

    border-radius:8px;

    cursor:pointer;

    box-shadow:
        0 2px 8px rgba(0,0,0,.08);
}

.pagination button.active{

    background:var(--primary);

    color:white;
	
	border-color:var(--primary);
}

.pagination button:disabled{

    opacity:.4;

    cursor:not-allowed;
}

.pagination-dots{

    color:var(--text-muted);

    font-weight:bold;
}

.mobile-page-info{

    padding:0 12px;

    font-weight:600;
}

.pagination button:hover:not(:disabled){

    background:var(--primary);

    color:white;

    border-color:var(--primary);
}

/* ======================
   ERRORS
====================== */

.error-container{
    display:none;
    margin-bottom:20px;
}

.error-box{

    background:var(--error-bg);

    border:1px solid var(--error-border);

    color:var(--error-text);

    padding:16px;

    border-radius:12px;

    box-shadow:
        0 2px 8px rgba(0,0,0,.05);
}

.error-box h3{
    margin-bottom:8px;
}

.error-box code{

    background:rgba(255,255,255,.15);

    padding:2px 6px;

    border-radius:4px;
}

/* ======================
   MODAL
====================== */

.modal{

    display:none;

    position:fixed;

    left:0;
    top:0;

    width:100%;
    height:100%;

    background:rgba(0,0,0,.75);

    z-index:9999;
}

.modal-content{

    background:var(--card);

    width:95%;

    max-width:850px;

    margin:5vh auto;

    border-radius:16px;

    overflow:hidden;
}

.modal-header{

    position:relative;

    background:
        linear-gradient(
            135deg,
            var(--primary),
			var(--primary-dark)
        );

    color:white;

    padding:30px;
}

.modal-body{
    padding:30px;
}

.modal-section{
    margin-bottom:25px;
}

.modal-section h3{

    color:var(--primary);

    margin-bottom:10px;
}

.close{

    position:absolute;

    top:10px;
    right:20px;

    font-size:32px;

    cursor:pointer;
}

/* ======================
   FOOTER
====================== */

footer{

    margin-top:50px;

    background:var(--primary-dark);

    color:white;

    text-align:center;

    padding:30px;
}

/* ======================
   MOBILE
====================== */

@media(max-width:768px){


	.grid{
		grid-template-columns:1fr;
	}

    .menu-toggle{
        display:block;
    }

    .nav-links{

        display:none;

        position:absolute;

        left:0;
        top:65px;

        width:100%;

        background:var(--primary-dark);

        flex-direction:column;

        padding:20px;
		
		box-shadow:
		0 8px 24px rgba(0,0,0,.2);
    }

    .nav-links.active{
        display:flex;
    }

    .filters{
        grid-template-columns:1fr;
    }

    .card{
        min-height:auto;
    }

    .modal-content{

        width:100%;

        margin:0;

        min-height:100vh;

        border-radius:0;
    }
	
	    .card-actions{

        flex-direction:column;
    }

    .favorite-btn,
    .remove-favorite-btn,
    .detail-btn{

        width:100%;
    }

    .subjekt-filter{

        flex-direction:column;
    }

    .subjekt-filter label{

        width:100%;
    }
}

.tahak-actions{

    margin-bottom:20px;

    display:flex;

    justify-content:flex-end;
}

#clearAllFavorites{

    background:#dc3545;

    color:white;

    border:none;

    border-radius:10px;

    padding:12px 18px;

    cursor:pointer;

    font-weight:600;
}

#clearAllFavorites:hover{

    background:#b02a37;
}

.theme-toggle{

    display:flex;

    align-items:center;

    justify-content:center;
	
	background:none;

    border:none;

    color:white;

    cursor:pointer;

    font-size:20px;

    min-width:44px;

    min-height:44px;

    padding:6px 10px;

    border-radius:8px;

    transition:.2s;
}

.theme-toggle:hover{

    background:
        rgba(255,255,255,.15);
}

.filters input:focus,
.filters select:focus{

    outline:none;

    border-color:var(--primary);

    box-shadow:
        0 0 0 3px color-mix(
            in srgb,
            var(--primary) 25%,
            transparent
        );
}

.detail-btn,
.remove-favorite-btn,
.favorite-btn{

    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.detail-btn:hover,
.remove-favorite-btn:hover,
.favorite-btn:hover{

    transform:translateY(-1px);
}
