/* integrama.css */

.integrama-body {
    min-height: 100vh;
    background-color: var(--bg-color) !important;
    background-image: url('../assets/img/subtle_circles.svg') !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    transition: background-color 0.3s ease;
}

.integrama-wrapper {
    padding-top: 80px;
    color: var(--text-color);
}

/* Ensure glass panel adapts to theme */
.integrama-wrapper .glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    color: var(--text-color);
}

.integrama-wrapper h1,
.integrama-wrapper .display-4 {
    color: var(--text-color);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.integrama-wrapper .lead {
    color: var(--secondary-text-color);
}

@media (max-width: 576px) {
    .integrama-wrapper {
        padding-top: 60px;
    }
    .integrama-wrapper .glass-panel {
        padding: 1rem !important;
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 0;
    }
}
.integrama-container-wrapper {
    overflow: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    box-shadow: inset 0 4px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    max-height: 80vh;
    scrollbar-width: thin;
    scrollbar-color: #27ae60 rgba(255,255,255,0.1);
    display: block;
}

body.dark-theme .integrama-container-wrapper {
    background: rgba(0, 0, 0, 0.7);
    box-shadow: inset 0 4px 25px rgba(0,0,0,0.9);
}


@media (max-width: 576px) {
    .integrama-container-wrapper {
        padding: 5px;
        border-radius: 4px;
    }
}

/* Custom Scrollbar for Chrome/Safari */
.integrama-container-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.integrama-container-wrapper::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
.integrama-container-wrapper::-webkit-scrollbar-thumb {
    background: #27ae60;
    border-radius: 10px;
}

.integrama-grid {
    display: grid;
    gap: 2px;
    background-color: #2c3e50;
    border: 4px solid #2c3e50;
    margin: 0 auto;
    border-radius: 4px;
    width: max-content;
    transform-origin: 0 0; /* Changed from top center to fix scroll issues */
    transition: transform 0.1s cubic-bezier(0.1, 0.7, 1.0, 0.1);
}

/* Base cell */
.integrama-cell {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05); /* Void color by default */
    position: relative;
    box-sizing: border-box;
}

/* Hint Box */
.integrama-cell.hint-cell {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: #ecf0f1;
    font-size: 0.6rem;
    line-height: 1.1;
    text-align: center;
    padding: 4px;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.hint-text {
    z-index: 2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

.hint-arrow {
    position: absolute;
    color: #f1c40f;
    font-size: 1.1rem;
    z-index: 1;
    opacity: 0.8;
}

.hint-arrow.right { right: 2px; top: 50%; transform: translateY(-50%); }
.hint-arrow.down { bottom: -2px; left: 50%; transform: translateX(-50%); }

/* Interactive Letter Box */
.integrama-cell.input-cell {
    background-color: #ffffff;
    border-radius: 2px;
}

.integrama-input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    color: #2c3e50;
    background: transparent;
    padding: 0;
    margin: 0;
    outline: none;
    transition: all 0.2s ease;
}

.integrama-input:focus {
    background-color: #e8f8f5;
    box-shadow: inset 0 0 0 3px #27ae60;
    transform: scale(1.05);  /* pop effect */
    z-index: 10;
    border-radius: 4px;
}

.integrama-input.correct {
    color: #27ae60 !important;
    background-color: #f0fff4 !important;
    border-radius: 4px;
}

/* Hide Void cells completely if they are at the edge */
.integrama-cell.void-cell {
    background-color: transparent;
}

/* Dark theme specific fixes */
.dark-theme .integrama-cell.input-cell {
    background-color: #ecf0f1;
}
.dark-theme .integrama-input {
    color: #1a1a2e;
}
.dark-theme .integrama-wrapper h1, 
.dark-theme .integrama-wrapper .display-4,
.dark-theme .integrama-wrapper p.lead,
.dark-theme .integrama-wrapper h4 {
    color: var(--text-color) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
