/* Kalanda 3D Gallery - Professional Minimal Dark Mode */

:root {
    --gallery-bg: #050505;
    --gallery-card-bg: #0a0a0a;
    --gallery-card-border: #1a1a1a;
    --gallery-text-main: #ffffff;
    --gallery-text-muted: #888888;
    --gallery-accent: #ffffff;
}

.kalanda-gallery-container {
    background-color: var(--gallery-bg);
    padding: 60px 20px;
    min-height: 100vh;
    color: var(--gallery-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.gallery-nav-header {
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 10px;
}

.back-home-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 2px;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
    z-index: 10;
    position: relative;
}

.back-home-link:hover {
    color: #ffffff;
    transform: translateX(-5px);
}

.back-home-link svg {
    transition: transform 0.3s ease;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Gallery Card */
.gallery-item {
    background: var(--gallery-card-bg);
    border: 1px solid var(--gallery-card-border);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-8px);
    border-color: #333;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.gallery-item-canvas-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle at center, #111 0%, #0a0a0a 100%);
    position: relative;
}

.gallery-item-info {
    padding: 20px;
    border-top: 1px solid var(--gallery-card-border);
}

.gallery-item-name {
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    color: #e0e0e0;
    text-align: center;
}

/* Loader for 3D */
.gallery-item-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gallery-text-muted);
}

/* Overlay Full View */
.gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #151515 0%, #050505 100%);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none; /* Controlled by JS */
    opacity: 0;
}

.gallery-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
}

.overlay-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    cursor: pointer;
    z-index: 10005; /* Highest level */
    transition: transform 0.3s ease;
}

.overlay-close:hover {
    transform: rotate(90deg);
}

.gallery-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 25px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10010;
}

.gallery-ctrl-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.gallery-ctrl-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.gallery-ctrl-btn svg {
    display: block;
}

.overlay-content {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 10002;
}

.overlay-3d-side {
    flex: 2.5; /* Approx 71% */
    background: transparent;
}

.overlay-text-side {
    flex: 1; /* Approx 35% */
    padding: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid #1a1a1a;
    background: #050505;
    position: relative;
    z-index: 10006; /* Above canvas */
}

.overlay-text-side h2 {
    font-size: 42px;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 300;
    color: #e0e0e0;
}

.overlay-description {
    font-size: 28px;
    line-height: 1.6;
    color: #e0e0e0;
    font-weight: 300;
    white-space: pre-wrap; /* Respect line breaks from desc.txt */
}

/* Responsive */
@media (max-width: 1024px) {
    .overlay-content {
        flex-direction: column;
    }
    .overlay-3d-side {
        flex: 1;
    }
    .overlay-text-side {
        padding: 40px;
        flex: none;
        border-left: none;
        border-top: 1px solid #1a1a1a;
    }
    .overlay-text-side h2 {
        font-size: 28px;
    }
}
