/* Highest voted purpose */
.highest-voted-purpose-card {
     --bg: #e8e8e8;
  --contrast: #e2e0e0;
  --grey: #93a1a1;
  position: relative;
  padding: 9px;
  background-color: var(--bg);
  border-radius: 35px;
  box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px, rgba(10, 37, 64, 0.35) 0px -2px 6px 0px inset;
  margin: 0 auto;
  max-width: 100%;
}

.card-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-conic-gradient(var(--bg) 0.0000001%, var(--grey) 0.000104%) 60% 60%/600% 600%;
  filter: opacity(10%) contrast(105%);
}

.card-inner {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  min-width: 250px;
  width: 100%;
  height: 150px;
  background-color: var(--contrast);
  border-radius: 30px;
  /* Content style */
  font-size: 1.8em;
  font-weight: 700;
  color: #000000;
  text-align: center;
  font-family: monospace;
  padding: 15px;
  word-wrap: break-word;
}



/* Purpose list */
.purpose-list-cards {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-wrap: wrap; /* Allows items to wrap to the next row */
    justify-content: center; /* Centers items horizontally when fewer than 4 */
    margin: 0 auto;
}

.purpose-list-cards .purpose-item-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  width: 250px;
  border-radius: 10px;
  border: solid 1px purple;
  background-color: #ffffff;
  color: purple;
  transition: 400ms transform, 400ms box-shadow, 400ms background-color;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  padding: 5px 5px;
}


.purpose-list-cards .purpose-item-card p.tip {
  font-size: 1em;
  font-weight: 700;
  margin: 0;
  padding: 0;
  line-height: 1.3;
}

.purpose-list-cards .purpose-item-card p.vote-count-second-text {
  font-size: 0.8em;
  font-weight: 500;
  margin: 0;
  padding: 0;
}

/* Voting form */
.voting-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.voting-form label {
    font-family: 'Open Sans', sans-serif;
    color: #333;
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.voting-form select {
    background-color: white;
    color: black;
    border: 2px solid #000000;
    border-radius: 8px;
    padding: 12px 15px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    min-height: 45px;
}

.voting-form select:hover {
    background-color: black;
    border-color: white;
    color: white;
    box-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
}

.voting-form select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.2);
}

/* From Uiverse.io by alexroumi */ 
.voting-form button {
 padding: 15px 25px;
 border: unset;
 border-radius: 15px;
 margin-top: 10px;
 color: #212121;
 z-index: 1;
 background: #e8e8e8;
 position: relative;
 font-weight: 1000;
 font-size: 17px;
 -webkit-box-shadow: 4px 8px 19px -3px rgba(0,0,0,0.27);
 box-shadow: 4px 8px 19px -3px rgba(0,0,0,0.27);
 transition: all 250ms;
 overflow: hidden;
 min-width: 120px;
 min-height: 50px;
}

.voting-form button::before {
 content: "";
 position: absolute;
 top: 0;
 left: 0;
 height: 100%;
 width: 0;
 border-radius: 15px;
 background-color: #212121;
 z-index: -1;
 -webkit-box-shadow: 4px 8px 19px -3px rgba(0,0,0,0.27);
 box-shadow: 4px 8px 19px -3px rgba(0,0,0,0.27);
 transition: all 250ms
}

.voting-form button:hover {
 color: #e8e8e8;
}

.voting-form button:hover::before {
 width: 100%;
}

.voting-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.vote-message {
    color: #28a745;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    text-align: center;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px 20px;
    margin: 10px auto;
    max-width: 400px;
    font-weight: 600;
}

/* ===== RESPONSIVE DESIGN ===== */


/* Tablet (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .highest-voted-purpose-card {
        max-width: 500px;
        padding: 8px;
    }
    
    .card-inner {
        height: 140px;
        font-size: 1.6em;
        min-width: 200px;
        padding: 12px;
    }
    

    .voting-form {
        max-width: 450px;
        padding: 25px;
    }
    
    .voting-form label {
        font-size: 1em;
    }
    
    .voting-form select {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .voting-form button {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Mobile Large (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .highest-voted-purpose-card {
        max-width: 450px;
        padding: 6px;
        border-radius: 25px;
    }
    
    .card-inner {
        height: 120px;
        font-size: 1.6em;
        min-width: 180px;
        border-radius: 20px;
        padding: 10px;
    } 

    .purpose-list-cards .purpose-item-card p.tip {
        font-size: 0.8em;
    }
    
    .purpose-list-cards .purpose-item-card p.vote-count-second-text {
        font-size: 0.75em;
    }
    
    
    .voting-form {
        max-width: 400px;
        padding: 20px;
        gap: 12px;
    }
    
    .voting-form label {
        font-size: 0.95em;
    }
    
    .voting-form select {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .voting-form button {
        padding: 10px 18px;
        font-size: 15px;
        min-height: 45px;
    }
    
    .vote-message {
        font-size: 13px;
        padding: 10px 15px;
        max-width: 350px;
    }
}

/* Mobile Small (up to 575px) */
@media (max-width: 575px) {
    .highest-voted-purpose-card {
        max-width: 100%;
        padding: 5px;
        border-radius: 20px;
        margin: 0 10px;
    }
    
    .card-inner {
        height: 100px;
        font-size: 1.2em;
        min-width: 150px;
        border-radius: 15px;
        padding: 8px;
        line-height: 1.2;
    }
    
    
    
    .purpose-list-cards .purpose-item-card p.tip {
        font-size: 0.8em;
    }
    
    .purpose-list-cards .purpose-item-card p.vote-count-second-text {
        font-size: 0.75em;
    }
    
    .voting-form {
        max-width: 100%;
        padding: 15px;
        gap: 10px;
        margin: 0 10px 15px 10px;
        border-radius: 12px;
    }
    
    .voting-form label {
        font-size: 0.9em;
        margin-bottom: 3px;
    }
    
    .voting-form select {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 38px;
        border-radius: 6px;
    }
    
    .voting-form button {
        padding: 8px 16px;
        font-size: 14px;
        min-height: 40px;
        border-radius: 12px;
    }
    
    .vote-message {
        font-size: 12px;
        padding: 8px 12px;
        margin: 5px 10px;
        border-radius: 6px;
    }
}

/* Extra Small Mobile (up to 375px) */
@media (max-width: 375px) {
    .highest-voted-purpose-card {
        margin: 0 5px;
    }
    
    .card-inner {
        height: 90px;
        font-size: 1em;
        min-width: 50px;
        padding: 6px;
    }
    
    
    .purpose-list-cards .purpose-item-card p.tip {
        font-size: 0.75em;
    }
    
    .purpose-list-cards .purpose-item-card p.vote-count-second-text {
        font-size: 0.7em;
    }
    
    .voting-form {
        padding: 12px;
        margin: 0 5px 10px 5px;
    }
    
    .voting-form label {
        font-size: 0.85em;
    }
    
    .voting-form select {
        padding: 7px 8px;
        font-size: 11px;
        min-height: 35px;
    }
    
    .voting-form button {
        padding: 7px 14px;
        font-size: 13px;
        min-height: 38px;
    }
    
    .vote-message {
        font-size: 11px;
        padding: 6px 10px;
        margin: 3px 5px;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .highest-voted-purpose-card {
        max-width: 400px;
    }
    
    .card-inner {
        height: 80px;
        font-size: 1.1em;
    }
    
    .purpose-list-cards {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .purpose-list-cards .purpose-item-card {
        flex-direction: column;
        text-align: center;
    }
    
    .purpose-list-cards .purpose-item-card p.tip {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .voting-form {
        max-width: 350px;
        padding: 15px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .highest-voted-purpose-card {
        box-shadow: rgba(50, 50, 93, 0.25) 0px 25px 50px -10px, rgba(0, 0, 0, 0.3) 0px 15px 30px -15px, rgba(10, 37, 64, 0.35) 0px -1px 3px 0px inset;
    }
    
    .purpose-list-cards .purpose-item-card {
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
    }
    
    .voting-form {
        box-shadow: 0 2.5px 7.5px rgba(0, 0, 0, 0.05);
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .purpose-list-cards .purpose-item-card,
    .voting-form select,
    .voting-form button,
    .voting-form button::before {
        transition: none;
    }
    
    .purpose-list-cards .purpose-item-card:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .highest-voted-purpose-card {
        --bg: #2a2a2a;
        --contrast: #3a3a3a;
        --grey: #555555;
    }
    
    .card-inner {
        color: #ffffff;
    }
    
    .purpose-list-cards .purpose-item-card {
        background-color: #2a2a2a;
        color: #e0b0ff;
        border-color: #e0b0ff;
    }
    
    .purpose-list-cards .purpose-item-card:hover {
        background-color: #3a3a3a;
    }
    
    .purpose-list-cards .purpose-item-card p.vote-count-second-text {
        color: #cccccc;
    }
    
    .voting-form {
        background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    }
    
    .voting-form label {
        color: #ffffff;
    }
    
    .voting-form select {
        background-color: #3a3a3a;
        color: #ffffff;
        border-color: #555555;
    }
    
    .voting-form select:hover {
        background-color: #555555;
        border-color: #ffffff;
    }
    
    .vote-message {
        background: #1e4d2b;
        border-color: #2d5a3a;
        color: #a8e6cf;
    }
}