/* Calanca container - grid layout */
#calanca-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    justify-items: center;
    align-items: stretch;
    padding: 20px 0;
}

.calanca-header-image {
    width: clamp(200px, 100%, 768px);
    margin: 0 auto;
}

/* Calanca item */
.calanca-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background-color: #000;
    cursor: pointer;
    color: white;
}

/* Selected calanca item */
.calanca-item.selected {
    border: 5px solid #ffcc00;
    box-shadow: 0 8px 16px rgba(255, 204, 0, 0.3);
    position: relative;
    transform: scale(1.05);
}

/* Checkmark icon for selected items */
.calanca-item.selected::before {
    content: "✓"; /* Unicode checkmark character */
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ffcc00;
    color: #333;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.calanca-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Calanca link */
.calanca-link {
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Ensure no text decoration for all elements inside the link */
.calanca-link * {
    text-decoration: none;
}

/* Calanca image */
.calanca-image {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.calanca-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fullscreen button */
.fullscreen-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fullscreen-button i {
    color: #fff !important;
}

.fullscreen-button:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Calanca info */
.calanca-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.calanca-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Instructions container with language switch */
.instructions-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.instructions-container .calanca-instructions {
    flex: 1;
    margin-right: 20px;
    margin-bottom: 0;
}

.calanca-votes {
    display: flex;
    align-items: center;
    font-size: 14px;
    justify-content: end;
}

.calanca-votes i {
    margin-right: 5px;
    color: #fff !important;
}

/* Vote container */
#calanca-vote-container {
    position: fixed;
    bottom: 200px;
    right: 50px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    text-align: center;
    z-index: 1000;
    display: none; /* Hidden by default, shown when images are selected */
    transition: transform 0.3s ease;
    border-radius: 4px;
}

#calanca-vote-button {
    background-color: #ffcc00;
    color: #333;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#calanca-vote-button:hover {
    background-color: #e6b800;
}

/* Phone number popup */
.phone-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.phone-popup-content {
    background-color: #f5f5f5;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.3s ease;
}

.close-popup:hover {
    color: #333;
}

.phone-popup h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
}

.phone-popup p {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

#phone-number {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

#phone-number:focus {
    border-color: #999;
    outline: none;
    box-shadow: 0 0 5px rgba(153, 153, 153, 0.3);
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 15px;
    display: none;
}

.success-message {
    color: #2ecc71;
    font-size: 16px;
    margin: 20px 0;
    display: none;
    text-align: center;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.success-text {
    font-size: 20px;
    font-weight: 600;
}

/* Verification codes container */
.verification-codes-container {
    display: none;
    margin-top: 20px;
    margin-bottom: 15px;
}

.verification-codes-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.verification-codes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.verification-code {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.verification-code:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.verification-code.selected {
    background-color: #ffcc00;
    border-color: #e6b800;
}

#submit-vote-button {
    background-color: #777;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

#submit-vote-button:hover {
    background-color: #666;
}


/* Language switch */
.language-switch {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.language-btn {
    padding: 5px 10px;
    margin-left: 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.language-btn.active {
    background-color: #ffcc00;
    border-color: #e6b800;
    color: #333;
    font-weight: bold;
}

.language-btn:hover {
    background-color: #e6e6e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .instructions-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .instructions-container .calanca-instructions {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .instructions-container .language-switch {
        align-self: flex-end;
    }

    #calanca-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    .calanca-item {
        width: 100%;
        max-width: 350px;
    }

    /* Selected calanca item */
    .calanca-item.selected {
        border: 5px solid #ffcc00;
        transform: none;
    }

    #calanca-vote-container {
        padding: 10px;
        bottom: 15px;
        right: 15px;
    }

    #calanca-vote-button {
        padding: 8px 16px;
        font-size: 14px;
    }

    .phone-popup-content {
        padding: 20px;
        width: 95%;
    }
}
