/* Estilos para o crachá interativo */
:root {
    --badge-front-bg: #ffffff;
    --badge-back-bg: #ec008c;
    --badge-text-front: #333;
    --badge-text-back: #ffffff;
    --badge-shadow: rgba(0, 0, 0, 0.1);
    --badge-highlight: rgba(255, 255, 255, 0.8);
    --badge-border: rgba(255, 255, 255, 0.2);
    --flip-duration: 0.6s;
}

.badge-container {
    width: 100%;
    height: 100%;
    position: relative;
    perspective: 1000px;
    cursor: pointer;
}

.badge-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    border-radius: 0.5rem;
    box-shadow: 
        0 10px 30px var(--badge-shadow),
        0 0 0 1px var(--badge-border);
    overflow: hidden;
}

.badge-card.flipped {
    transform: rotateY(180deg);
}

.badge-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0) 60%
    );
    border-radius: 0.5rem;
    z-index: 2;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.badge-card:hover::before {
    opacity: 0.8;
}

.badge-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 0.5rem;
    box-sizing: border-box;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.badge-front {
    background-color: var(--badge-front-bg);
    color: var(--badge-text-front);
}

.badge-back {
    background-color: var(--badge-back-bg);
    color: var(--badge-text-back);
    transform: rotateY(180deg);
}

/* Efeito holográfico */
.badge-face::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 400% 400%;
    border-radius: 0.5rem;
    z-index: 1;
    animation: gradient 15s ease infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.badge-card:hover .badge-face::after {
    opacity: 1;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.badge-hole {
    width: 15px;
    height: 15px;
    background-color: #e0e0e0;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid #ccc;
    z-index: 10;
}

/* Efeito de brilho */
.shine {
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shine 4s infinite;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.badge-card:hover .shine {
    opacity: 1;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(30deg);
    }
    20%, 100% {
        transform: translateX(100%) rotate(30deg);
    }
}

/* --- Content Styling --- */

/* Front Face Content */
.content-front {
    margin-top: 25px;
    width: 100%;
    text-align: left;
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.badge-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--badge-text-front);
}

.badge-title {
    font-size: 0.875rem;
    color: #555;
    background-color: #eee;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.badge-photo {
    width: 100%;
    flex-grow: 1;
    background-color: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.badge-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-logo {
    width: 60px;
    height: 25px;
    background-color: #f8f8f8;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    border-radius: 4px;
}

.badge-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.badge-footer {
    font-size: 0.75rem;
    color: #777;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

/* Back Face Content */
.content-back {
    margin-top: 25px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    position: relative;
    z-index: 3;
    height: 100%;
}

.badge-main-text {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: auto;
    padding-top: 30px;
}

.badge-logo-back {
    width: 80px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    margin-bottom: 15px;
    border-radius: 4px;
}

.badge-logo-back img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Modo escuro */
.dark-mode .badge-front {
    background-color: #2d2d2d;
    color: #f0f0f0;
}

.dark-mode .badge-title {
    background-color: #444;
    color: #e0e0e0;
}

.dark-mode .badge-photo,
.dark-mode .badge-logo {
    background-color: #3a3a3a;
}

.dark-mode .badge-footer {
    color: #aaa;
}
