/* ==========================================
   1. GRID SYSTEM (4 Columns on Desktop/Laptop)
   ========================================== */
.cyber-flip-grid {
    display: grid;
    gap: 25px;
    padding: 20px;
    /* Forces 4 columns on screens wider than 1024px */
    grid-template-columns: repeat(4, 1fr); 
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .cyber-flip-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets */
    }
}

@media (max-width: 600px) {
    .cyber-flip-grid {
        grid-template-columns: 1fr; /* 1 column for mobile */
    }
}

/* ==========================================
   2. CARD CORE LOGIC
   ========================================== */
.flip-card-container {
    background-color: transparent;
    perspective: 1000px;
    width: 100%;
    /* Set a minimum height so cards look consistent */
    min-height: 300px; 
    display: flex;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flip-card-container:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, 
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden; /* Clips anything outside the rounded corners */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ==========================================
   3. FRONT SIDE (Image + Name)
   ========================================== */
.flip-card-front {
    background: #424242;
    color: white;
}

.candidate-avatar {
    width: 100%;
    flex-shrink: 0; /* Keeps the white image area from being squashed */
    background: #fff;
    line-height: 0;
}

.candidate-avatar img {
    width: 100%;
    height: auto;
    display: block;
}

.card-info-area {
    flex-grow: 1; /* Makes the grey area fill the rest of the card */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Keeps text tucked under the image */
    padding: 20px;
    background: #424242;
}

.flip-card-front h3 { 
    font-size: 18px; 
    margin: 0; 
    color: #ffffff;
    font-weight: 700;
    line-height: 1.3;
    word-wrap: break-word; /* Fixes long name overflow */
}

.flip-card-front p { 
    font-size: 14px; 
    color: #cccccc; 
    margin-top: 8px;
    margin-bottom: 0;
}

/* ==========================================
   4. BACK SIDE (Success Details)
   ========================================== */
.flip-card-back {
    background: #424242;
    color: white;
    transform: rotateY(180deg);
    padding: 20px;
}

.back-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #25d366 !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #25d366;
    padding-bottom: 5px;
}

.flip-tags-wrapper {
    width: 100%;
    text-align: left;
}

.flip-tag {
    font-size: 13px;
    background: rgba(255,255,255,0.08);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.flip-tag strong { 
    color: #25d366; 
    font-size: 11px; 
    display: block; 
    text-transform: uppercase; 
}

.flip-tag.gold { border-left: 4px solid #ffd700; }
.flip-tag.highlight { border-left: 4px solid #25d366; }