/* ===================================================
   eRepublik Tools - Peluka.info
   Dark theme CSS
   =================================================== */

/* --- Base --- */
body {
    background-color: #060509;
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: small;
    color: #fff;
    margin: 0;
    padding: 0;
}

h1 {
    color: white;
}

/* --- Layout helpers --- */
.box {
    display: inline-block;
    margin: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
}

.center {
    text-align: center;
    vertical-align: bottom;
}

.my-form {
    color: white;
    background: #101010;
    margin: 0 auto;
    text-align: center;
}

.panelGridCenter {
    margin: 0 auto;
    background: #101010;
}

/* --- Card --- */
.card {
    border-radius: 4px;
    background: #030507;
    padding: 1.25rem;
    border: 0 none;
    margin-bottom: 2rem;
    box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
    text-align: center;
}

/* --- Grid (PrimeFaces legacy) --- */
.p-grid {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
}

.p-grid > .p-col,
.p-grid > [class*=p-col] {
    box-sizing: border-box;
}

.p-col-12 {
    width: 100%;
    background: black;
}

.p-col {
    flex-grow: 1;
    flex-basis: 0;
    padding: 0.5rem;
}

.p-col-fixed {
    flex: 0 0 auto;
    padding: 0.5rem;
}

.p-col-align-start {
    align-self: flex-start;
}

.p-col-align-end {
    align-self: flex-end;
}

.p-col-align-center {
    align-self: center;
}

/* --- PrimeFaces Widget Overrides --- */
.ui-widget {
    font-family: Arial, sans-serif;
    font-size: 1.1em;
    color: white;
}

.ui-widget .ui-widget {
    font-size: 1em;
}

.ui-widget-content {
    border: 1px solid #000;
    background: #1a203b;
    color: #fff;
}

.ui-widget-content a {
    color: #ffffff;
}

.ui-widget-header {
    border: 1px solid #070606;
    background: #07072f linear-gradient(90deg, rgba(40, 35, 79, 1) 80%, rgba(40, 35, 79, 0) 100%);
    font-weight: bold;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
    color: white;
}

.ui-state-default, .ui-widget-content .ui-state-default {
    border: 1px solid #070606;
    background: #050515 linear-gradient(90deg, rgba(40, 35, 79, 1) 80%, rgba(40, 35, 79, 0) 100%);
    color: #fff;
}

.ui-state-default {
    box-shadow: inset 0 1px 0 rgba(199, 199, 199, 0.2);
}

.ui-state-default .ui-column-title {
    font-weight: normal;
}

.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
    color: white;
    text-shadow: none;
}

.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
    color: #fff;
    text-decoration: none;
}

.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover,
.ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
    box-shadow: inset 0 0 0.5px 0.5px rgba(255, 255, 255, 0.7), 0 0 0.5px 0.5px rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: #252525;
    font-weight: normal;
    color: #fff;
}

.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
    border: 1px solid #666;
    background: #101010;
    color: #fff;
}

/* --- DataTable --- */
.ui-datatable .ui-datatable-header {
    border-bottom: 0 none;
    padding: 30px 10px;
}

/* --- Menu --- */
.ui-menuitem-text {
    color: white;
    text-shadow: none;
}

.ui-tabs .ui-tabs-nav {
    border: 1px solid #070606;
    background: #07072f linear-gradient(90deg, rgba(40, 35, 79, 1) 80%, rgba(40, 35, 79, 0) 100%);
    font-weight: bold;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
    color: white;
}

/* --- Packs indicators --- */
td .packs {
    display: block;
}

.packs.yes {
    background-color: darkgreen;
    color: white;
}

.packs.no {
    background-color: darkred;
    color: white;
}

/* --- Party column --- */
.pparty {
    width: 15%;
}

/* --- Links --- */
.peluka-link {
    background: #1a203b;
    color: #fff;
}

/* --- Dialog --- */
body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon .ui-icon-closethick {
    font-family: "primeicons" !important;
    font-style: normal;
    font-weight: normal;
    display: inline-block;
    background: none;
}

body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon {
    border: 0 none;
    padding: 0;
    margin-left: .5rem;
    width: 2rem;
    height: 2rem;
    background: transparent;
    color: #6c757d;
    transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
    border-radius: 50%;
    text-align: center;
    line-height: 2rem;
    user-select: none;
}

body .ui-icon {
    font-size: 1rem;
    display: inline-block;
    vertical-align: baseline;
    margin: 0;
    position: static;
    text-indent: 0;
    overflow: visible;
    background-repeat: no-repeat;
}

/* --- Force white text EVERYWHERE --- */
body, body span, body div, body td, body th, body label, body p,
.ui-outputlabel, .ui-panelgrid td, .ui-panelgrid tr td,
.my-form, .my-form span, .my-form div, .my-form label,
.box, .box span, .center span,
.ui-widget span, .ui-widget div, .ui-widget label,
.ui-panel-content span, .ui-panel-content div {
    color: #fff !important;
}

/* Disclaimer slightly dimmer */
.disclaimer, .disclaimer span, .disclaimer em {
    color: #aaa !important;
}

/* --- Calculator-specific --- */
.no-hover {
    box-shadow: none;
    border: none;
    background: #101010;
    font-weight: normal;
    color: #fff;
}

.ui-inputfield {
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
    text-align: center;
    background: #101010;
    color: #fff;
}

.ui-slider-horizontal {
    box-shadow: inset 0 0 0.5px 0.5px rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.ui-slider-horizontal .ui-slider-handle {
    box-shadow: inset 0 0 0.5px 0.5px rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    top: -0.25rem;
    margin-left: -.6em;
    cursor: pointer;
}

.ui-toggleswitch {
    vertical-align: middle;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
}

.ui-toggleswitch .ui-toggleswitch-slider {
    background: #333 !important;
    border: 2px solid #666 !important;
    border-radius: 1rem;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    transition: background 0.3s;
}

.ui-toggleswitch .ui-toggleswitch-slider:before {
    background-color: #aaa !important;
    border: none !important;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    top: 0.15rem;
    left: 0.2rem;
    transition: transform 0.3s;
}

.ui-toggleswitch-checked .ui-toggleswitch-slider {
    background: #4a7c4a !important;
    border-color: #6a6 !important;
}

.ui-toggleswitch-checked .ui-toggleswitch-slider:before {
    background-color: white !important;
    transform: translateX(1.4rem);
}

.ui-button-text-only .ui-button-text {
    padding: .3rem 1rem;
    background: #101010;
}

/* --- Disclaimer --- */
.disclaimer {
    font-size: 0.85em;
    color: #aaa;
    text-align: center;
    margin: 20px auto;
    padding: 10px;
    max-width: 700px;
    line-height: 1.5;
    font-style: italic;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

/* --- Dialog wider + close button visible --- */
.ui-dialog {
    min-width: 700px !important;
}

body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon {
    color: #ff6666 !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

body .ui-dialog .ui-dialog-titlebar .ui-dialog-titlebar-icon:hover {
    color: #ff3333 !important;
    background: rgba(255, 255, 255, 0.2) !important;
}

/* --- Citizen Search centered --- */
.citizen-search-form {
    text-align: center;
    max-width: 800px;
    margin: 20px auto;
}

/* --- Footer --- */
.footer {
    width: 100px;
    height: 100px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .p-grid {
        flex-direction: column;
    }

    .p-col, .p-col-12 {
        width: 100%;
        flex-basis: 100%;
    }

    .ui-datatable {
        font-size: 0.85em;
    }

    .box {
        display: block;
        margin: 5px auto;
    }
}
