/* General Layout */
.ps-survey-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: #f4f7f6;
    min-height: 100vh;
}

/* Professional Government Header - FORCE STYLES */
.ps-gov-header {
    background: #003366 !important; 
    text-align: center !important; 
    padding: 30px 10px !important;
    border-bottom: 5px solid #ff9900 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    box-sizing: border-box;
}

.ps-gov-header h1 {
    margin: 0 !important;
    font-size: 28px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: #ffffff !important; 
    text-align: center !important;
    line-height: 1.3 !important;
}

.ps-gov-header p {
    margin: 10px 0 0 0 !important;
    font-size: 16px !important;
    color: #ffff00 !important; 
    text-align: center !important;
}

/* Controls */
.ps-controls {
    text-align: center;
    margin: 25px 0;
}
#ps-compare-btn {
    background: #2980b9;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 25px; /* Rounded button for modern look */
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
#ps-compare-btn:disabled {
    background: #bdc3c7;
    box-shadow: none;
    cursor: not-allowed;
}
#ps-compare-btn:not(:disabled):hover {
    background: #1f6391;
    transform: translateY(-2px);
}

/* GRID LAYOUT - Mobile First (Horizontal Cards) */
.ps-grid {
    display: flex;
    flex-direction: column; 
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.ps-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: row; 
    align-items: center;
    padding: 15px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eaeaea;
}

.ps-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.ps-rank-badge {
    position: absolute;
    top: 0; left: 0;
    background: #e74c3c;
    color: #fff;
    padding: 6px 15px;
    font-weight: bold;
    font-size: 14px;
    border-bottom-right-radius: 12px;
    border-top-left-radius: 12px;
    z-index: 2;
}

.ps-compare-checkbox {
    position: absolute;
    top: 15px; right: 15px;
    transform: scale(1.4);
    cursor: pointer;
    z-index: 2;
}

.ps-img-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #f4f7f6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ps-candidate-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Base Mobile Typography */
.ps-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ps-info h3 { 
    margin: 0 0 5px 0; 
    font-size: 18px; 
    color: #2c3e50;
}
.ps-ward-info { 
    font-size: 13px; 
    color: #7f8c8d; 
    margin: 0 0 8px 0; 
    line-height: 1.4;
}
.ps-stars { color: #f1c40f; margin: 0 0 5px 0; font-size: 14px; }
.ps-likes-count { color: #e67e22; font-size: 18px; margin: 5px 0 10px 0; font-weight: bold; }

.ps-vote-btn {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 20px; /* Pill shape */
    cursor: pointer;
    font-weight: bold;
    width: 110px; 
    transition: background 0.3s ease;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}
.ps-vote-btn:hover { background: #2980b9; }

/* =========================================
   DESKTOP LAYOUT (4 Columns Grid) - UPGRADED
   ========================================= */
@media (min-width: 768px) {
    .ps-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Responsive Grid */
        gap: 25px;
    }
    
    .ps-card {
        flex-direction: column;
        padding: 30px 20px 20px 20px; /* Better padding */
    }
    
    .ps-img-wrapper {
        margin: 15px auto 20px auto; /* perfectly centered horizontally */
        width: 130px;
        height: 130px;
    }

    .ps-info {
        width: 100%;
        align-items: center; /* Forces all children to center perfectly */
        text-align: center; 
    }

    .ps-info h3 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    /* Force Center Alignment for Desktop Text */
    .ps-ward-info, .ps-likes-count, .ps-stars {
        text-align: center !important;
        width: 100%;
    }

    .ps-vote-btn {
        margin: 10px auto 0 auto; /* Centered button */
        padding: 10px 20px;
        font-size: 14px;
        width: 130px;
    }
}

/* Modal Styling */
.ps-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}
.ps-modal-content {
    background: #f4f7f6; padding: 30px;
    border-radius: 12px; width: 90%; max-width: 800px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.ps-close {
    position: absolute; top: 15px; right: 20px;
    font-size: 30px; cursor: pointer; color: #333;
}
#ps-compare-results {
    display: flex; gap: 20px; justify-content: space-around; margin-top: 20px;
}
#ps-compare-results .ps-card { width: 45%; margin: 0; }
@media (max-width: 767px) {
    #ps-compare-results { flex-direction: column; }
    #ps-compare-results .ps-card { width: 100%; }
}