/* Check-in Plugin Styles */

/*
 * Wrapper runt shortcode: i smala innehållskolumner (flex/grid) blir roten annars
 * lika smal som mittenrutan — då hamnar %-positionerade namnknappar ovanpå boxen.
 * Full viewport-bredd utan transform (så knappars transform-animationer inte påverkas).
 */
.checkin-root {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
}

.checkin-container {
    background: transparent;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100vh;
}

.checkin-welcome-box {
    width: 600px;
    height: 800px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 40px 30px;
    z-index: 10;
}

.checkin-welcome-text {
    color: white;
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 15px;
    margin-top: 40px;
    font-weight: bold;
    opacity: 0;
    animation: checkin-fadeInScale 0.6s ease-out forwards;
}

.checkin-participant-name {
    color: #6fcf71;
    font-size: 2.5em;
    text-align: center;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    opacity: 0;
    animation: checkin-fadeInScale 0.6s ease-out 0.3s forwards, checkin-glow 2s ease-in-out 1s infinite alternate;
}

@keyframes checkin-fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes checkin-glow {
    from { text-shadow: 2px 2px 4px rgba(0,0,0,0.1); }
    to { text-shadow: 0 0 20px rgba(111, 207, 113, 0.6); }
}

.checkin-mini-names-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 80px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-content: flex-end;
    justify-content: space-evenly;
    align-items: flex-end;
}

.checkin-mini-name {
    background: white;
    color: #333;
    padding: 8px 16px;
    border: 1px solid #333333;
    border-radius: 25px;
    font-size: 1.4em;
    font-weight: 500;
    transform: rotate(var(--rotation));
    opacity: 0;
    animation: checkin-fadeInMini 0.5s ease forwards;
    animation-delay: var(--delay);
    position: relative;
    z-index: 1;
}

/* Skapa ännu mer överlappande effekt för att spara plats */
.checkin-mini-name:nth-child(even) {
    margin-left: -12px;
    z-index: 2;
}

.checkin-mini-name:nth-child(3n) {
    margin-top: -8px;
    z-index: 3;
}

.checkin-mini-name:nth-child(4n) {
    margin-left: -16px;
    margin-top: -6px;
    z-index: 4;
}

.checkin-mini-name:nth-child(5n) {
    margin-top: -10px;
    z-index: 5;
}

@keyframes checkin-fadeInMini {
    from { opacity: 0; transform: translateY(20px) rotate(var(--rotation)); }
    to { opacity: 1; transform: translateY(0) rotate(var(--rotation)); }
}

.checkin-name-button {
    background: white;
    color: #212121;
    border: none;
    padding: 6px 12px;
    font-size: 1.25em; /* slightly smaller */
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    font-weight: 400;
    letter-spacing: 0.3px;
    position: absolute;
    z-index: 20;
    max-width: 24vw; /* prevent oversized width on long names */
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkin-name-button:hover {
    transform: translateY(-3px) scale(1.05);
    background: #6fcf71;
    color: white;
    border: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.checkin-name-button.clicked {
    animation: checkin-moveToCenter 2s ease-in-out forwards;
}

@keyframes checkin-moveToCenter {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(calc(50vw - var(--start-left) - 90px)) translateY(calc(50vh - var(--start-top) - 20px)) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translateX(calc(50vw - var(--start-left) - 90px)) translateY(calc(50vh - var(--start-top) - 20px)) scale(0);
        opacity: 0;
    }
}

/* Positionering av knappar - FULLSTÄNDIG VIEWPORT-UTNYTTJANDE */

/* Alla 25 knappar fördelade över hela viewport höjd (5% till 95%) */
.checkin-name-button:nth-child(1) { top: 8%; left: 10%; }
.checkin-name-button:nth-child(2) { top: 11.4%; right: 14%; }
.checkin-name-button:nth-child(3) { top: 14.8%; left: 14%; }
.checkin-name-button:nth-child(4) { top: 18.2%; right: 10%; }
.checkin-name-button:nth-child(5) { top: 21.6%; left: 12%; }
.checkin-name-button:nth-child(6) { top: 25.0%; right: 12%; }
.checkin-name-button:nth-child(7) { top: 28.4%; left: 8%; }
.checkin-name-button:nth-child(8) { top: 31.8%; right: 16%; }
.checkin-name-button:nth-child(9) { top: 35.2%; left: 16%; }
.checkin-name-button:nth-child(10) { top: 38.6%; right: 8%; }
.checkin-name-button:nth-child(11) { top: 42.0%; left: 14%; }
.checkin-name-button:nth-child(12) { top: 45.4%; right: 14%; }
.checkin-name-button:nth-child(13) { top: 48.8%; left: 10%; }
.checkin-name-button:nth-child(14) { top: 52.2%; right: 12%; }
.checkin-name-button:nth-child(15) { top: 55.6%; left: 12%; }
.checkin-name-button:nth-child(16) { top: 59.0%; right: 10%; }
.checkin-name-button:nth-child(17) { top: 62.4%; left: 6% !important; right: auto !important; }
.checkin-name-button:nth-child(18) { top: 65.8%; right: 6% !important; left: auto !important; }
.checkin-name-button:nth-child(19) { top: 76%; left: 4%; }
.checkin-name-button:nth-child(20) { top: 80%; right: 4%; }
.checkin-name-button:nth-child(21) { top: 84%; left: 8%; }
.checkin-name-button:nth-child(22) { top: 88%; right: 8%; }
.checkin-name-button:nth-child(23) { top: 91%; left: 10%; }
.checkin-name-button:nth-child(24) { top: 94%; right: 10%; }
.checkin-name-button:nth-child(25) { top: 97%; left: 8%; }

/* Ensure last rows sit above the glass box and don't span full width */
.checkin-name-button:nth-child(n+19) {
	z-index: 20;
}

/* Constrain the very last two to edges to avoid center overlap */
.checkin-name-button:nth-child(24) {
	right: 2% !important;
}
.checkin-name-button:nth-child(25) {
	left: 2% !important;
}

.checkin-confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    animation: checkin-confetti-fall-box linear forwards;
    z-index: 25;
}

@keyframes checkin-confetti-fall-box {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(650px) rotate(720deg);
        opacity: 0;
    }
}

.checkin-complete-button {
    position: absolute;
    top: 20px;
    right: 150px;
    background: white;
    color: #212121;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    font-weight: 400;
}

.checkin-complete-button:hover {
    background: #6fcf71;
    color: white;
    border: none;
    transform: scale(1.05);
}

.checkin-start-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    color: #212121;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
}

.checkin-start-button:hover {
    background: #6fcf71;
    color: white;
    border: none;
    transform: scale(1.05);
}

.checkin-checkmark-container {
    width: 150px;
    height: 150px;
    background: #6fcf71;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkin-checkmarkPop 0.6s ease-out;
}

.checkin-checkmark {
    font-size: 4em;
    color: white;
    font-weight: bold;
}

@keyframes checkin-checkmarkPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.checkin-completed-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.checkin-start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.checkin-start-title {
    font-size: 3em;
    color: white;
    font-weight: bold;
    margin-bottom: 40px;
    text-align: center;
}

.checkin-bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checkin-bullet-item {
    font-size: 1.4em;
    color: white;
    margin: 20px 0;
    padding-left: 50px;
    position: relative;
    opacity: 0;
    animation: checkin-bulletFadeIn 0.6s ease-out forwards;
    display: flex;
    align-items: center;
}

.checkin-bullet-item:nth-child(1) {
    animation-delay: 0.3s;
}

.checkin-bullet-item:nth-child(2) {
    animation-delay: 0.6s;
}

.checkin-bullet-item:nth-child(3) {
    animation-delay: 0.9s;
}

.checkin-bullet-item::before {
    content: "✓";
    position: absolute;
    left: 0;
    width: 30px;
    height: 30px;
    background: #6fcf71;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

@keyframes checkin-bulletFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =============================================================================
   RESPONSIVE DESIGN - ENFORCED WITH !IMPORTANT
   ============================================================================= */

/* Large tablets and smaller desktops */
@media screen and (max-width: 1199px) {
    .checkin-welcome-box {
        width: 500px !important;
        height: 650px !important;
    }
    
    .checkin-welcome-text {
        font-size: 1.3em !important;
        margin-top: 20px !important;
    }
    
    .checkin-participant-name {
        font-size: 1.6em !important;
        margin-bottom: 15px !important;
    }
    
    .checkin-name-button {
        font-size: 1.1em !important;
        padding: 4px 8px !important;
    }
    
    .checkin-mini-name {
        font-size: 0.9em !important;
        padding: 4px 8px !important;
    }
    
    .checkin-mini-names-container {
        height: 60px !important;
    }
    
    .checkin-start-title {
        font-size: 1.8em !important;
        margin-bottom: 15px !important;
    }
    
    .checkin-bullet-item {
        font-size: 0.9em !important;
        margin: 8px 0 !important;
    }
    
    /* Responsive button positioning - adjust horizontal positions */
    .checkin-name-button:nth-child(1), .checkin-name-button:nth-child(3), 
    .checkin-name-button:nth-child(5), .checkin-name-button:nth-child(7),
    .checkin-name-button:nth-child(9), .checkin-name-button:nth-child(11),
    .checkin-name-button:nth-child(13), .checkin-name-button:nth-child(15) {
        left: 13% !important;
    }
    
    .checkin-name-button:nth-child(2), .checkin-name-button:nth-child(4), 
    .checkin-name-button:nth-child(6), .checkin-name-button:nth-child(8),
    .checkin-name-button:nth-child(10), .checkin-name-button:nth-child(12),
    .checkin-name-button:nth-child(14), .checkin-name-button:nth-child(16) {
        right: 13% !important;
    }
    
    /* Avoid stretching by not setting both left and right */
    .checkin-name-button:nth-child(n+17):nth-child(odd) { left: 8% !important; right: auto !important; }
    .checkin-name-button:nth-child(n+17):nth-child(even) { right: 8% !important; left: auto !important; }
}

/* Tablets and large mobile */
@media screen and (max-width: 991px) {
    .checkin-welcome-box {
        width: 400px !important;
        height: 500px !important;
    }
    
    .checkin-welcome-text {
        font-size: 1.1em !important;
        margin-top: 15px !important;
    }
    
    .checkin-participant-name {
        font-size: 1.3em !important;
        margin-bottom: 12px !important;
    }
    
    .checkin-name-button {
        font-size: 0.9em !important;
        padding: 3px 6px !important;
    }
    
    .checkin-mini-name {
        font-size: 0.7em !important;
        padding: 3px 6px !important;
    }
    
    .checkin-mini-names-container {
        height: 50px !important;
        gap: 2px !important;
    }
    
    .checkin-start-title {
        font-size: 1.4em !important;
        margin-bottom: 12px !important;
    }
    
    .checkin-bullet-item {
        font-size: 0.8em !important;
        margin: 6px 0 !important;
        padding-left: 25px !important;
    }
    
    .checkin-bullet-item::before {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.5em !important;
    }
    
    /* Medium responsive button positioning */
    .checkin-name-button:nth-child(1), .checkin-name-button:nth-child(3), 
    .checkin-name-button:nth-child(5), .checkin-name-button:nth-child(7),
    .checkin-name-button:nth-child(9), .checkin-name-button:nth-child(11),
    .checkin-name-button:nth-child(13), .checkin-name-button:nth-child(15) {
        left: 10% !important;
    }
    
    .checkin-name-button:nth-child(2), .checkin-name-button:nth-child(4), 
    .checkin-name-button:nth-child(6), .checkin-name-button:nth-child(8),
    .checkin-name-button:nth-child(10), .checkin-name-button:nth-child(12),
    .checkin-name-button:nth-child(14), .checkin-name-button:nth-child(16) {
        right: 10% !important;
    }
    
    .checkin-name-button:nth-child(n+17):nth-child(odd) { left: 6% !important; right: auto !important; }
    .checkin-name-button:nth-child(n+17):nth-child(even) { right: 6% !important; left: auto !important; }
}

/* Mobile devices */
@media screen and (max-width: 767px) {
    .checkin-container {
        padding: 10px !important;
    }
    
    .checkin-welcome-box {
        width: 70vw !important;
        max-width: 300px !important;
        height: 400px !important;
        padding: 15px 10px !important;
    }
    
    .checkin-welcome-text {
        font-size: 0.9em !important;
        margin-top: 10px !important;
    }
    
    .checkin-participant-name {
        font-size: 1em !important;
        margin-bottom: 8px !important;
    }
    
    .checkin-name-button {
        font-size: 0.7em !important;
        padding: 2px 4px !important;
    }
    
    .checkin-mini-name {
        font-size: 0.5em !important;
        padding: 2px 4px !important;
    }
    
    .checkin-mini-names-container {
        height: 30px !important;
        gap: 1px !important;
    }
    
    .checkin-start-title {
        font-size: 1.1em !important;
        margin-bottom: 8px !important;
    }
    
    .checkin-bullet-item {
        font-size: 0.7em !important;
        margin: 4px 0 !important;
        padding-left: 20px !important;
    }
    
    .checkin-bullet-item::before {
        width: 15px !important;
        height: 15px !important;
        font-size: 0.4em !important;
    }
    
    /* Mobile button positioning - closer to edges */
    .checkin-name-button:nth-child(1), .checkin-name-button:nth-child(3), 
    .checkin-name-button:nth-child(5), .checkin-name-button:nth-child(7),
    .checkin-name-button:nth-child(9), .checkin-name-button:nth-child(11),
    .checkin-name-button:nth-child(13), .checkin-name-button:nth-child(15) {
        left: 6% !important;
    }
    
    .checkin-name-button:nth-child(2), .checkin-name-button:nth-child(4), 
    .checkin-name-button:nth-child(6), .checkin-name-button:nth-child(8),
    .checkin-name-button:nth-child(10), .checkin-name-button:nth-child(12),
    .checkin-name-button:nth-child(14), .checkin-name-button:nth-child(16) {
        right: 6% !important;
    }
    
    .checkin-name-button:nth-child(n+17):nth-child(odd) { left: 3% !important; right: auto !important; }
    .checkin-name-button:nth-child(n+17):nth-child(even) { right: 3% !important; left: auto !important; }
    
    .checkin-complete-button,
    .checkin-start-button {
        padding: 4px 6px !important;
        font-size: 0.6em !important;
    }
    
    .checkin-complete-button {
        right: 50px !important;
    }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
    .checkin-container {
        padding: 5px !important;
    }
    
    .checkin-welcome-box {
        width: 80vw !important;
        max-width: 250px !important;
        height: 350px !important;
        padding: 10px 8px !important;
    }
    
    .checkin-welcome-text {
        font-size: 0.7em !important;
        margin-top: 8px !important;
    }
    
    .checkin-participant-name {
        font-size: 0.9em !important;
        margin-bottom: 6px !important;
    }
    
    .checkin-name-button {
        font-size: 0.5em !important;
        padding: 1px 3px !important;
    }
    
    .checkin-mini-name {
        font-size: 0.4em !important;
        padding: 1px 3px !important;
    }
    
    .checkin-mini-names-container {
        height: 25px !important;
        gap: 1px !important;
    }
    
    .checkin-start-title {
        font-size: 0.9em !important;
        margin-bottom: 6px !important;
    }
    
    .checkin-bullet-item {
        font-size: 0.6em !important;
        margin: 3px 0 !important;
        padding-left: 15px !important;
    }
    
    .checkin-bullet-item::before {
        width: 12px !important;
        height: 12px !important;
        font-size: 0.3em !important;
    }
    
    /* Small mobile - very close to edges */
    .checkin-name-button:nth-child(1), .checkin-name-button:nth-child(3), 
    .checkin-name-button:nth-child(5), .checkin-name-button:nth-child(7),
    .checkin-name-button:nth-child(9), .checkin-name-button:nth-child(11),
    .checkin-name-button:nth-child(13), .checkin-name-button:nth-child(15) {
        left: 2% !important;
    }
    
    .checkin-name-button:nth-child(2), .checkin-name-button:nth-child(4), 
    .checkin-name-button:nth-child(6), .checkin-name-button:nth-child(8),
    .checkin-name-button:nth-child(10), .checkin-name-button:nth-child(12),
    .checkin-name-button:nth-child(14), .checkin-name-button:nth-child(16) {
        right: 2% !important;
    }
    
    .checkin-name-button:nth-child(n+17):nth-child(odd) { left: 1% !important; right: auto !important; }
    .checkin-name-button:nth-child(n+17):nth-child(even) { right: 1% !important; left: auto !important; }
    
    .checkin-complete-button,
    .checkin-start-button {
        padding: 2px 4px !important;
        font-size: 0.4em !important;
        top: 3px !important;
    }
    
    .checkin-complete-button {
        right: 30px !important;
    }
    
    .checkin-start-button {
        right: 2px !important;
    }
}

/* =============================================================================
   TYPOGRAPHY - LINE HEIGHT FOR NAMES
   ============================================================================= */

/* Base: provide more breathing room for names */
.checkin-name-button,
.checkin-mini-name,
.checkin-participant-name {
    line-height: 1.4;
}

/* Tablets and large mobile */
@media screen and (max-width: 991px) {
    .checkin-name-button,
    .checkin-mini-name,
    .checkin-participant-name {
        line-height: 1.3 !important;
    }
}

/* Mobile devices */
@media screen and (max-width: 767px) {
    .checkin-name-button,
    .checkin-mini-name,
    .checkin-participant-name {
        line-height: 1.2 !important;
    }
}

/* =============================================================================
   LAYOUT - EDGE MARGINS FOR NAME BUTTONS
   Bias buttons toward screen edges to keep distance from center box
   ============================================================================= */

/* Desktops and large screens */
@media screen and (min-width: 1200px) {
    .checkin-name-button:nth-child(odd) {
        left: 6% !important;
        right: auto !important;
    }
    .checkin-name-button:nth-child(even) {
        right: 6% !important;
        left: auto !important;
    }
    .checkin-name-button:nth-child(n+17):nth-child(odd) { left: 4% !important; right: auto !important; }
    .checkin-name-button:nth-child(n+17):nth-child(even) { right: 4% !important; left: auto !important; }
}

/* Large tablets and smaller desktops */
@media screen and (max-width: 1199px) and (min-width: 992px) {
    .checkin-name-button:nth-child(odd) {
        left: 8% !important;
        right: auto !important;
    }
    .checkin-name-button:nth-child(even) {
        right: 8% !important;
        left: auto !important;
    }
    .checkin-name-button:nth-child(n+17):nth-child(odd) { left: 6% !important; right: auto !important; }
    .checkin-name-button:nth-child(n+17):nth-child(even) { right: 6% !important; left: auto !important; }
}

/* Tablets and large mobile */
@media screen and (max-width: 991px) and (min-width: 768px) {
    .checkin-name-button:nth-child(odd) {
        left: 6% !important;
        right: auto !important;
    }
    .checkin-name-button:nth-child(even) {
        right: 6% !important;
        left: auto !important;
    }
    .checkin-name-button:nth-child(n+17):nth-child(odd) { left: 4% !important; right: auto !important; }
    .checkin-name-button:nth-child(n+17):nth-child(even) { right: 4% !important; left: auto !important; }
}
