/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* CSS Variables for colors and styles */
:root {
    --background-gradient: linear-gradient(135deg, #1e0a5c, #3d1b8c, #2c0b6b);
    --card-background: rgba(255, 255, 255, 0.1);
    --card-border: 1px solid rgba(255, 255, 255, 0.2);
    --text-color: #f0f0f0;
    --text-color-secondary: #b3b3b3;
    --primary-button-gradient: linear-gradient(90deg, #3a8dfe, #6b47ff);
    --green-color: #28a745;
    --white-color: #fff;
    --font-family: 'Poppins', sans-serif;
}

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(188.64deg, #E8EDFF 39.84%, #183EC2 92.29%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 80px; /* Accounts for fixed navbar height */
}

/* Navbar */
.navbar {
    display: flex;
    width: 100%;
    padding: 20px 40px;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-sizing: border-box;
    flex-wrap: nowrap; /* Prevents wrapping */
    height: 80px; /* Matches governance page and accommodates larger profile icon */
}

.navbar .logo {
    font-weight: bold;
    font-size: 22px;
    color: #333;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar .logo span {
    background: linear-gradient(to right, #ff00cc, #3333ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar .profile-icon {
    width: 48px; /* Larger size as requested */
    height: 48px;
    border-radius: 50%;
    background: #fff; /* Placeholder background */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 15px; /* Consistent gap from logo */
    /* Replace with actual image */
    background-image: url('profile-icon.png'); /* Update with your icon path */
    background-size: cover;
    background-position: center;
}

.gwei-indicator {
    display: inline-flex;
    align-items: center;
    background-color: #000000;
    padding: 7px;
    border-radius: 50px;
    font-family: 'Inter', sans-serif; /* Matches governance page */
    font-size: 16px;
    flex-shrink: 0;
    margin-left: 400px; /* Matches governance page for right alignment */
}

.blinking-dot {
    height: 18px;
    width: 18px;
    background-color: #e91414;
    border-radius: 50%;
    margin-left: 5px;
    margin-right: 5px;
    animation: blink 2.2s infinite ease-in-out;
}

.indicator-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.2px;
    font-family: 'Inter', sans-serif; /* Matches governance page */
}

.indicator-text .version {
    color: #4ade80;
    font-weight: 600;
    font-size: 16px;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.2; }
    100% { opacity: 1; }
}

.navbar ul {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center; /* Center the nav items */
    gap: 20px; /* Matches governance page */
    padding: 0;
    margin: 0 auto; /* Center the ul, matches governance page */
    font-family: sans-serif; /* Matches governance page */
    flex-grow: 1; /* Allow ul to take available space for centering */
    max-width: 50%; /* Restrict width to prevent overlap */
    flex-shrink: 0;
}

.navbar ul li {
    font-size: 16px;
    cursor: pointer;
}

.navbar ul li a {
    text-decoration: none;
    color: inherit;
}

.navbar a:hover,
.nav-item a:focus {
    color: #FF00E5;
}
#connectWalletBtn{
    margin-right: 10px;
}

.navbar .wallet {
    background: black;
    color: white;
    padding: 8px 16px; /* Matches governance page */
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold; /* Matches governance page */
    font-family: sans-serif; /* Matches governance page */
    font-size: 16px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.navbar .wallet:hover {
    background: #333;
}
.user-profile a {
    color: #000000;
    font-size: 24px;
    margin-right: 5px;
    transition: color 0.3s ease;
}

.user-profile a:hover {
    color: #ff00e5;
}


#copyResultBtn{
    border-radius: 10px;
     flex-grow: 1;
    /* background: var(--card-background); */
    border: var(--card-border);
    /* color: var(--text-color); */
    padding: 0.8rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
     /* display: flex; */
    gap: 1rem;
}
#copyResultBtn:hover {
     background: rgba(255, 255, 255, 0.2);
}
/* Responsive Adjustments for Navbar */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px; /* Matches governance page */
        height: 60px;
    }
    .navbar .logo {
        font-size: 18px;
    }
    .navbar .profile-icon {
        width: 36px; /* Smaller for mobile */
        height: 36px;
        margin-left: 10px;
    }
    .navbar ul {
        display: none; /* Matches governance page */
    }
    .gwei-indicator {
        padding: 5px;
        font-size: 14px;
        margin-left: 10px; /* Adjusted for mobile */
    }
    .blinking-dot {
        height: 16px;
        width: 16px;
        margin-left: 4px;
        margin-right: 4px;
    }
    .indicator-text,
    .indicator-text .version {
        font-size: 14px;
    }
    .navbar .wallet {
        padding: 6px 12px;
        font-size: 14px;
        margin-left: 0; /* Matches governance page */
    }
}

/* Grid Layout */
.container {
    padding: 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: auto;
    margin-top: 100px;
    margin-bottom: 20px;
    border: 14px solid rgba(239, 240, 246, 0.45);
    background: rgba(150, 150, 150, 0.20);
    border-radius: 50px;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        margin-top: 80px;
    }
}

/* Main Content */
main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    background-color: #D8DCEA;
    border: 13px solid #E2E4EF;
    padding: 30px 20px;
    border-radius: 25px;
    margin-top: 100px;
}

/* Glassmorphism Card Style */
.card {
    background: var(--card-background);
    border: var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Left Panel */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.voting-topic h2 {
    font-weight: 500;
}

.details .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #020202;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--green-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.options h3 {
    margin-bottom: 1rem;
    font-weight: 500;
}

.option-btn {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    font-size: 1.1rem;
    font-weight: 500;
}

.option-btn:hover {
    background: rgba(0, 0, 0, 0.4);
}

.option-btn.selected {
    background: rgba(107, 71, 255, 0.3);
    border-color: #6b47ff;
}

.transaction-status-card {
    display: none;
}

/* Right Panel */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.time-left,
.results {
    text-align: center;
}

.time-left h3,
.results h3 {
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.timer-circle,
.results-circle {
    position: relative;
    width: 170px;
    height: 170px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-circle {
    /* background: conic-gradient(#6b47ff 360deg, #333 0deg); */
    /* background-color: hsl(0, 14%, 99%); */
    /* background-color: #D8DCEA; */
    
}
#electionIdDisplay {
    font-size: 1rem;
    font-weight: bold;
}
#electionEndTime{
    font-size: 0.9rem;
    font-weight: bold;

}
#countdownTimer{
  font-size: 1rem;
    font-weight: bold;  
}

.results-circle {
    /* background: conic-gradient(#3a8dfe 277.2deg, #ff4b4b 277.2deg 360deg); */
    background-color: blue;
}

.circle-inner {
    position: absolute;
    width: 120px;
    height: 120px;
    /* background: #2a1a5e; */
    background-color: hsl(0, 14%, 99%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
}

.results-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submit-btn {
    background: var(--primary-button-gradient);
    border: none;
    color: var(--white-color);
    padding: 1rem;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.submit-btn:hover {
    opacity: 0.9;
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.link-buttons {
    display: flex;
    gap: 1rem;
}

.link-btn {
    flex-grow: 1;
    background: var(--card-background);
    border: var(--card-border);
    color: var(--text-color);
    padding: 0.8rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.link-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

#statusMessage {
    margin-top: 1rem;
    text-align: center;
    min-height: 22px;
    word-wrap: break-word;
    font-weight: 500;
}

/* Footer */
footer {
    background: #0d0d1a;
    padding: 3rem;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-column h4 {
    color: var(--white-color);
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: var(--text-color-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-column a:hover {
    color: var(--white-color);
}

.footer-logo {
    width: 100px;
    height: 100px;
    background: var(--primary-button-gradient);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(107, 71, 255, 0.5);
}

.footer-logo-text {
    font-weight: 700;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-direction: column;
        gap: 1rem;
        height: auto;
        padding: 10px 20px;
    }
}

@media (max-width: 768px) {
    .navbar,
    main,
    footer {
        padding: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

#election-search-container {
    text-align: center;
    margin-bottom: 1rem;
}

#electionSearchForm {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

#electionSearchInput {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

#electionSearchForm button {
    padding: 8px 16px;
    border-radius: 6px;
    background: #3a8dfe;
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

#loadingMessage {
    margin-top: 8px;
    color: #3a8dfe;
    display: none;
}

.election-topic-description-section {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
    background: #f3f6fa;
    border-radius: 8px;
    padding: 10px 0;
}

#electionTopicDescription {
    color: #222;
    font-size: 1.05rem;
    margin: 0;
}

#electionTopicText {
    font-weight: 500;
    color: #3a8dfe;
}

#criteriaContainer {
    background: #f9fafd;
    border-radius: 14px;
    padding: 1.5rem 1rem;
    margin-top: 1rem;
    box-shadow: 0 2px 12px rgba(60,80,180,0.06);
    color: #23254a;
}

.criteria-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #3a8dfe;
    text-align: left;
}

.criteria-list {
    list-style: disc inside;
    padding-left: 1.1rem;
    margin: 0;
}

.criteria-item {
    margin-bottom: 0.7rem;
    font-size: 1.02rem;
    line-height: 1.5;
    padding-left: 0.2rem;
}

.criteria-loading,
.criteria-error,
.criteria-empty {
    color: #ff4b4b;
    font-size: 1rem;
    text-align: left;
    margin-top: 0.5rem;
}

.criteria-failed {
    color: #ff4b4b;
    font-weight: bold;
}

.criteria-success {
    color: #28a745;
    font-weight: bold;
}

.criteria-failed::before {
    content: "❌ ";
}