body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
    color: #333;
}

/* Normalize box-sizing to avoid sizing differences from borders/padding */
*, *:before, *:after { box-sizing: border-box; }

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(90deg, #0b5ed7, #0062cc);
    color: #fff;
    padding: 1rem 0.5rem;
}

.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand h1 {
    margin: 0;
    font-size: 1.6rem;
}

.brand .tag {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.main-nav a { color: rgba(255,255,255,0.95); margin-left: 1rem; text-decoration: none; }
.main-nav .nav-cta { background: rgba(255,255,255,0.12); padding: 8px 12px; border-radius: 6px; }

/* Header nav buttons */
.nav-btn, .nav-cta { display:inline-flex; align-items:center; height:36px; padding:0 12px; border-radius:8px; font-weight:600; }
.nav-btn { color: rgba(255,255,255,0.95); background: transparent; border: 1px solid rgba(255,255,255,0.12); }
.nav-cta { background: rgba(255,255,255,0.14); color:#fff; border: 1px solid rgba(255,255,255,0.12); }

#hero {
    background-color: #f4f4f4;
    padding: 4rem 0;
    text-align: center;
}

#hero h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #007BFF;
    color: #fff;
    padding: 0 20px;
    height: 44px;
    min-width: 150px;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.12s ease;
    border: 1px solid transparent; /* keep same box as secondary */
    line-height: 1; /* ensure vertical centering inside */
}

.cta-button:hover {
    background-color: #0056b3;
}

#features {
    padding: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    background: #fff;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #007BFF;
    color: #007BFF;
    padding: 0 20px;
    height: 44px;
    min-width: 150px;
    border-radius: 8px;
    margin-left: 12px;
    line-height: 1;
}

#my-votes { padding: 3rem 0; background: #fbfcfe; }
.vote-card { background: #fff; padding: 1.5rem; border-radius: 8px; border: 1px solid #e6e9ef; display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.vote-text { margin: 0; font-weight:600; }
.vote-actions { display:flex; align-items:center; }

@media (max-width:600px) {
    .header-grid { flex-direction: column; gap:10px; text-align:center; }
    .vote-card { flex-direction:column; }
    .vote-actions { width:100%; display:flex; gap:10px; flex-direction:column; }
    .vote-actions .cta-button, .vote-actions .secondary-button { width:100%; min-width: 0; }
}

/* Ensure buttons inside .vote-actions align vertically center in desktop */
.vote-actions { display:flex; align-items:center; }
.vote-actions .cta-button, .vote-actions .secondary-button { vertical-align: middle; }

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Modal styles for app availability check */
.modal { display: none; position: fixed; inset: 0; z-index: 9999; align-items: center; justify-content: center; }
.modal[aria-hidden="false"] { display: flex; }
.modal-backdrop { position: absolute; inset:0; background: rgba(0,0,0,0.45); }
.modal-panel { position: relative; background: #fff; max-width: 520px; width: 95%; border-radius: 10px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 1; }
.modal-panel h3 { margin-top: 0; }
.modal-actions { display:flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid #eee; border-top-color: #007BFF; animation: spin 1s linear infinite; display:inline-block; vertical-align:middle; margin-right:10px; }
@keyframes spin { to { transform: rotate(360deg);} }
