:root {
    --bg-color: #0f0c29;
    --text-color: #ffffff;
    --accent-color: #ff0076;
    --ball-size: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0;
}

/* Background Animation Effect */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.app-container {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    max-width: 95%;
    width: 800px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

/* Tab Navigation Styles */
.tab-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 12px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(45deg, #ff00cc, #333399);
    box-shadow: 0 0 15px rgba(255, 0, 204, 0.4);
}

/* Tab Content Styles */
.tab-content {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Iframe & AI Container */
.iframe-container, .ai-model-container {
    width: 100%;
    min-height: 500px;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.model-info {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

#webcam-container {
    width: 300px;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(255, 0, 118, 0.3);
    margin-bottom: 2rem;
    background: #000;
}

#webcam-container canvas {
    width: 100% !important;
    height: 100% !important;
}

#label-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.label-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.class-name {
    width: 100px;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-bar {
    flex-grow: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff00cc, #333399);
    transition: width 0.2s ease;
}

.probability {
    width: 45px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--accent-color);
}

.glow-on-hover.small {
    width: 180px;
    height: 45px;
    font-size: 1rem;
    margin-bottom: 20px;
}

.title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(to right, #ff00cc, #333399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(255, 0, 204, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); filter: brightness(100%); }
    50% { transform: scale(1.02); filter: brightness(120%); }
}

.numbers-wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 3rem;
    min-height: var(--ball-size);
}

.ball {
    width: var(--ball-size);
    height: var(--ball-size);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, #888888);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 
        inset -5px -5px 10px rgba(0,0,0,0.5),
        inset 5px 5px 10px rgba(255,255,255,0.5),
        5px 5px 15px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Specific Ball Colors based on ranges (Korea Lotto styles commonly) */
.ball.range-1 { /* 1-10: Yellow */
    background: radial-gradient(circle at 30% 30%, #ffd700, #ffaa00);
}
.ball.range-2 { /* 11-20: Blue */
    background: radial-gradient(circle at 30% 30%, #00bfff, #007acc);
}
.ball.range-3 { /* 21-30: Red */
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #cc0000);
}
.ball.range-4 { /* 31-40: Grey */
    background: radial-gradient(circle at 30% 30%, #a0a0a0, #505050);
}
.ball.range-5 { /* 41-45: Green */
    background: radial-gradient(circle at 30% 30%, #7cfc00, #228b22);
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glow-on-hover {
    width: 220px;
    height: 50px;
    border: none;
    outline: none;
    color: #fff;
    background: #111;
    cursor: pointer;
    position: relative;
    z-index: 0;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 1px;
    transition: transform 0.2s;
}

.glow-on-hover:before {
    content: '';
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    position: absolute;
    top: -2px;
    left: -2px;
    background-size: 400%;
    z-index: -1;
    filter: blur(5px);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    animation: glowing 20s linear infinite;
    opacity: 0;
    transition: opacity .3s ease-in-out;
    border-radius: 10px;
}

.glow-on-hover:active {
    color: #000;
}

.glow-on-hover:active:after {
    background: transparent;
}

.glow-on-hover:hover:before {
    opacity: 1;
}

.glow-on-hover:after {
    z-index: -1;
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #111;
    left: 0;
    top: 0;
    border-radius: 10px;
}

.glow-on-hover:active {
    transform: scale(0.95);
}

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

@media (max-width: 600px) {
    .title { font-size: 2rem; }
    .ball { width: 45px; height: 45px; font-size: 1.2rem; }
}
