/* Index page specific styles - TOP TITLE, BOTTOM BOX, FLOATING WALLET */

/* --- Color Palette & Variables (Keep from Spy Theme) --- */
:root {
    --spy-dark-bg: rgba(15, 20, 35, 0.85); /* Deep blue/black transparent */
    --spy-border-glow: rgba(255, 215, 0, 0.3); /* Subtle gold border */
    --spy-text-primary: #e0e0e0;
    --spy-text-secondary: #a0a0b0;
    --spy-gold-accent: #FFD700; /* Gold */
    --spy-gold-hover: #fffacd; /* Lighter gold for hover */
    --spy-blue-accent: #4a90e2;
    --spy-red-alert: #f04a4f; 
    --spy-green-connect: #34c759;
    --spy-button-shadow: rgba(0, 0, 0, 0.4);
    --spy-button-inset-shadow: rgba(255, 255, 255, 0.1);
}

/* --- Base Index Page Setup --- */
body.index-page {
    display: flex;
    flex-direction: column; /* Align items vertically */
    justify-content: space-between; /* Push header top, content box bottom */
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    background-color: #0a0f18; /* Fallback */
    padding: 30px 20px 20px 20px; /* More top padding */
    box-sizing: border-box;
}

/* Background with pan/zoom effect */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 120%; /* Larger than viewport to allow movement */
    height: 120%;
    background-image: url('indexbg.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    transition: transform 15s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- Top Aligned Page Header --- */
.page-header {
    width: 100%;
    text-align: center;
    flex-shrink: 0; /* Prevent shrinking */
    margin-bottom: 20px; /* Space below header */
    position: relative; /* Ensure it's above potential overlays */
    z-index: 2;
}

#pageTitle {
    font-size: 72px; /* Base size for mobile */
    font-weight: 700;
    color: var(--spy-gold-accent);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0 0 3px 0;
    text-shadow: 0 6px 15px rgba(0, 0, 0, 0.7);
    line-height: 0.9;
}

#pageSubtitle {
    font-size: 24px; /* Base size for mobile */
    font-weight: 600;
    color: var(--tg-theme-hint-color, var(--spy-text-secondary));
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
    opacity: 0.8;
}

/* --- Bottom Aligned Content Box --- */
.content-box {
    background-color: rgba(15, 20, 35, 0.88);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border-radius: 12px; /* Consistent radius */
    padding: 25px 20px; /* Adjusted padding */
    width: 100%;
    max-width: 400px; /* Can be slightly wider */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px; /* Reduced space since wallet button is at top */
}

/* Button Container within Content Box */
.buttons {
    display: flex;
    flex-direction: column;
    gap: 14px; /* Slightly smaller gap */
    width: 100%; /* Buttons take full width of content-box */
}

/* --- Button Styles (Inside Content Box) --- */
.index-page .content-box .button { 
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    cursor: pointer;
    transition: all 0.2s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0px rgba(255, 255, 255, 0.05);
    opacity: 1;
    text-align: center;
    font-family: var(--spy-font-family);
    width: 100%; /* Make buttons fill container */
}

/* Primary Button */
.index-page .content-box .button:not(.secondary) {
    background: linear-gradient(180deg, #282d3a, #1e222c);
    color: var(--spy-gold-accent);
    border-color: rgba(255, 215, 0, 0.5);
}

.index-page .content-box .button:not(.secondary):hover {
    background: linear-gradient(180deg, #303545, #252935);
    color: var(--spy-gold-hover);
    border-color: var(--spy-gold-hover);
    box-shadow: 0 0 12px var(--spy-gold-glow), 0 4px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0px rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.index-page .content-box .button:not(.secondary):active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 3px rgba(0,0,0,0.2);
    transition-duration: 0.05s;
    filter: brightness(0.9);
}

/* Secondary Buttons */
.index-page .content-box .button.secondary {
    background-color: rgba(93, 156, 236, 0.1);
    color: var(--tg-theme-link-color);
    border-color: rgba(93, 156, 236, 0.4);
}

.index-page .content-box .button.secondary:hover {
    background-color: rgba(93, 156, 236, 0.2);
    color: #8fc1f2;
    border-color: #8fc1f2;
    box-shadow: 0 0 10px var(--spy-blue-glow), 0 3px 5px rgba(0, 0, 0, 0.3), inset 0 1px 0px rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.index-page .content-box .button.secondary:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 3px rgba(0,0,0,0.15);
    transition-duration: 0.05s;
    filter: brightness(0.9);
}

/* --- Floating Wallet Button --- */
.wallet-button-floating {
    border-radius: 6px; /* Match other buttons */
    width: auto; /* Let padding determine width */
    height: auto; /* Let padding determine height */
    padding: 10px 16px; /* Slightly larger padding for better tap target */
    font-size: 15px; /* Increased from 13px to 15px (+2px) */
    font-weight: 600; /* Consistent weight */
    letter-spacing: 0.6px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Use relative positioning to stay in flow */
    margin: 0 auto 5px auto; /* Reduced margin (75% less) between wallet button and content box */
    z-index: 10; /* Above other elements */
    border: 1px solid; /* Use 1px border for consistency */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    color: #ffffff; /* Pure white text */
    line-height: 1.2;
    text-align: center;
    transition: all 0.2s ease-out;
    cursor: pointer;
}

/* Disconnected State (Red Gradient) */
.wallet-button-floating:not(.connected) {
    background: linear-gradient(135deg, #e06b68, #c9302c); /* Brighter red gradient */
    border-color: rgba(255, 150, 150, 0.7); /* Lighter red border */
    color: #ffffff; /* Pure white text instead of tinted */
}

.wallet-button-floating:not(.connected):hover {
    background: linear-gradient(135deg, #e87d7a, #d64541); 
    box-shadow: 0 0 12px rgba(240, 74, 79, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: scale(1.03) translateY(-1px);
    border-color: rgba(255, 180, 180, 0.8);
}

/* Connected State (Green Gradient) */
.wallet-button-floating.connected {
    background: linear-gradient(135deg, #6fdc6f, #4cae4c); /* Brighter green */
    border-color: rgba(150, 255, 150, 0.7); /* Lighter green border */
    color: #ffffff; /* Pure white text instead of tinted */
}

.wallet-button-floating.connected:hover {
    background: linear-gradient(135deg, #82e882, #5cc45c);
    box-shadow: 0 0 12px rgba(52, 199, 89, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: scale(1.03) translateY(-1px);
    border-color: rgba(180, 255, 180, 0.8);
}

/* Active State */
.wallet-button-floating:active {
    transform: scale(0.96); /* Press effect */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    filter: brightness(0.95);
    transition-duration: 0.05s;
}

/* --- Admin Button --- */
.admin-button {
    position: absolute;
    top: 15px; /* Changed from bottom */
    right: 15px; /* Added */
    display: none; 
    padding: 5px 9px;
    background-color: rgba(240, 74, 79, 0.2);
    color: var(--spy-red-alert);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    z-index: 100;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-button:hover {
    background-color: rgba(240, 74, 79, 0.4);
    color: #f5c6cb;
    opacity: 1;
    box-shadow: 0 0 6px rgba(240, 74, 79, 0.5);
}

.admin-button:active {
    transform: scale(0.96);
    filter: brightness(0.8);
}

/* --- Modal Styles (Keep Spy Theme) --- */
/* Base Modal Overlay */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 15, 25, 0.85); /* Darker overlay */
    backdrop-filter: blur(8px) saturate(110%);
    -webkit-backdrop-filter: blur(8px) saturate(110%);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out; /* Transition opacity */
}

/* Make modal visible */
.modal.visible {
    display: flex; /* Use flex for centering */
    opacity: 1;
}

/* Modal Content Box */
.modal-content {
    background: linear-gradient(155deg, #2a3040, #1f2430);
    border-radius: 10px; /* Slightly larger radius */
    padding: 25px 30px 30px 30px;
    width: 100%;
    max-width: 360px; /* Adjusted max-width */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    /* Add transform for pop-in effect */
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease-out;
    font-family: var(--spy-font-family);
}

/* Animate content when modal is visible */
.modal.visible .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--spy-gold-accent);
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.modal-description {
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.7;
    color: var(--tg-theme-hint-color);
}

.wallet-input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background-color: rgba(10, 15, 25, 0.5);
    color: var(--tg-theme-text-color);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 18px;
    transition: all 0.2s ease;
}

.wallet-input:focus {
    outline: none;
    border-color: var(--spy-gold-accent);
    background-color: rgba(10, 15, 25, 0.7);
    box-shadow: 0 0 7px var(--spy-gold-glow);
}

.button-row {
    display: flex;
    gap: 10px;
}

.modal-button {
    flex: 1;
    padding: 9px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25), inset 0 1px 0px rgba(255, 255, 255, 0.06);
}

.save-button {
    background: linear-gradient(180deg, var(--spy-gold-accent), #e6b800);
    color: #10141f; /* Dark blue text */
    border-color: rgba(255, 215, 0, 0.7);
}

.save-button:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 10px var(--spy-gold-glow), 0 3px 5px rgba(0, 0, 0, 0.3), inset 0 1px 0px rgba(255, 255, 255, 0.1);
}

.cancel-button {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--tg-theme-hint-color);
    border-color: rgba(255, 255, 255, 0.2);
}

.cancel-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--tg-theme-text-color);
    border-color: rgba(255, 255, 255, 0.3);
}

.modal-button:active {
    transform: scale(0.97);
    filter: brightness(0.9);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(0,0,0,0.15);
    transition-duration: 0.05s;
}

/* Media queries for responsive design */
@media (min-width: 768px) {
    #pageTitle {
        font-size: 120px; /* Larger on desktop/tablet */
        letter-spacing: 6px;
    }
    
    #pageSubtitle {
        font-size: 40px; /* Larger on desktop/tablet */
        letter-spacing: 5px;
    }
}

/* Fix for container on index page */
.index-page .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100vh;
}

/* Removed unused rules */
/* .content-wrapper { ... } */
/* .header { ... } */
/* .logo { ... } */
/* .button-group { ... } */
/* .info-text { ... } */

.footer button:active {
    transform: scale(0.96);
}

/* --- Glowing Button Effect --- */
@keyframes glowing {
    0% { box-shadow: 0 0 5px rgba(255, 50, 50, 0.7), 0 0 5px rgba(255, 50, 50, 0.6) inset; } /* Red glow */
    50% { box-shadow: 0 0 15px 3px rgba(255, 50, 50, 1.0), 0 0 10px rgba(255, 50, 50, 0.8) inset; } /* Brighter red glow */
    100% { box-shadow: 0 0 5px rgba(255, 50, 50, 0.7), 0 0 5px rgba(255, 50, 50, 0.6) inset; } /* Red glow */
}

.glowing-button {
    animation: glowing 1800ms infinite ease-in-out;
    border-color: rgba(255, 50, 50, 0.9) !important; /* Red border */
    /* Ensure background isn't interfering too much, maybe slightly lighter? */
    /* background-color: rgba(93, 156, 236, 0.15); Optional: Uncomment if needed */
} 