/**
 * QR Code Modal styling
 * Styles for QR code display and loading animations
 */

/* Loading animation for glyphicon refresh */
.glyphicon-refresh-animate {
    animation: spin 1s infinite linear;
}

@keyframes spin {
    from {
        transform: scale(1) rotate(0deg);
    }
    to {
        transform: scale(1) rotate(360deg);
    }
}

/* QR code image styling */
.qr-code-image {
    max-width: 300px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: white;
}

/* Loading indicator styling */
.loading {
    padding: 20px;
    color: #666;
}

/* QR Modal body layout */
#qrModal .modal-body {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.vs-widgets {
    margin: 20px 0;
}

/* Responsive iframe container for VolleyStation widgets */
.vs-widgets .iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-bottom: 15px;
}

/* Different aspect ratios for different widgets */
.vs-widgets .iframe-container.court {
    padding-top: 50%; /* 2:1 aspect ratio for court view */
}

.vs-widgets .iframe-container.scoreboard {
    padding-top: 116.67%; /* Taller aspect ratio for scoreboard */
}

.vs-widgets .iframe-container.play-by-play {
    padding-top: 35%; /* Wider aspect ratio for play-by-play */
}

.vs-widgets .iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Stack iframes vertically on mobile */
@media (max-width: 767px) {
    .vs-widgets .iframe-container {
        width: 100% !important;
        max-width: 100%;
    }

    .vs-widgets .iframe-container.court {
        padding-top: 60%; /* Adjust for mobile */
    }

    .vs-widgets .iframe-container.scoreboard {
        padding-top: 100%;
    }

    .vs-widgets .iframe-container.play-by-play {
        padding-top: 120%; /* Taller on mobile for better readability */
    }
}

/* On larger screens, allow side-by-side layout for smaller widgets */
@media (min-width: 768px) {
    .vs-widgets .iframe-row {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }

    .vs-widgets .iframe-container.court {
        flex: 1 1 65%;
        min-width: 600px;
        padding-top: 350px; /* Fixed height on desktop */
        height: 350px;
    }

    .vs-widgets .iframe-container.scoreboard {
        flex: 1 1 30%;
        min-width: 250px;
        padding-top: 350px; /* Fixed height on desktop */
        height: 350px;
    }

    .vs-widgets .iframe-container.play-by-play {
        flex: 1 1 100%;
        padding-top: 350px; /* Fixed height on desktop */
        height: 350px;
    }
}
