/* Tower View Page Styles */
.asc-tower-view {
    position: relative;
    width: 100%;
    min-height: 100vh;
    color: var(--text-primary);
    padding-bottom: 80px; /* Space for bottom nav */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    background-color: transparent; /* Ensure no background color blocks the image */
}

.asc-tower-view__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Theme-based backgrounds */
.asc-theme-number {
    background-image: url('/_content/Ascend.Shared.UI/images/backgrounds/forest.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100vh;
    width: 100vw;
}

.asc-theme-algebra {
    background-image: url('/_content/Ascend.Shared.UI/images/backgrounds/forest.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100vh;
    width: 100vw;
}

.asc-theme-probability {
    background-image: url('/_content/Ascend.Shared.UI/images/backgrounds/forest.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100vh;
    width: 100vw;
}

.asc-theme-geometry {
    background-image: url('/_content/Ascend.Shared.UI/images/backgrounds/forest.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100vh;
    width: 100vw;
}

.asc-theme-ratio {
    background-image: url('/_content/Ascend.Shared.UI/images/backgrounds/forest.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100vh;
    width: 100vw;
}

.asc-theme-default {
    background-image: url('/_content/Ascend.Shared.UI/images/backgrounds/forest.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100vh;
    width: 100vw;
}

/* Apply overlay to make text readable */
.asc-tower-view__content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 0;
    pointer-events: none;
}

/* Player Info Panel */
.asc-tower-view__player-info {
    display: flex;
    align-items: center;
    background: var(--primary-blue-dark);
    border-radius: var(--radius-lg);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--primary-blue-light);
    position: relative;
    z-index: 1;
    color: var(--text-primary);
}

.asc-tower-view__avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    border: 2px solid var(--primary-blue-light);
    box-shadow: 0 0 10px var(--shadow-blue);
}

    .asc-tower-view__avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.asc-tower-view__player-stats {
    flex: 1;
}

.asc-tower-view__player-name {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.asc-tower-view__player-class {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.asc-tower-view__experience {
    width: 100%;
}

.asc-tower-view__experience-bar {
    height: 8px;
    background-color: var(--bg-dark);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 4px;
}

.asc-tower-view__experience-fill {
    height: 100%;
    background: linear-gradient(to right, var(--experience-color), var(--experience-color-light));
    border-radius: var(--radius-pill);
    transition: width var(--transition-medium);
}

.asc-tower-view__experience-text {
    font-size: 0.8rem;
    text-align: right;
    color: var(--text-secondary);
}

/* Floor Navigation */
.asc-tower-view__floor-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    background: var(--primary-blue-dark);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    z-index: 1;
    color: var(--text-primary);
}

.asc-tower-view__floor-title {
    text-align: center;
    font-size: 1.5rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    flex: 1;
}

.asc-tower-view__nav-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-backdrop);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

    .asc-tower-view__nav-button:hover:not(.asc-tower-view__nav-button--disabled) {
        background: var(--primary-blue-light);
        border-color: var(--primary-blue-light);
        transform: scale(1.1);
    }

.asc-tower-view__nav-button--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Current Floor */
.asc-tower-view__floor {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    position: relative;
    z-index: 1;
}

.asc-tower-view__nodes-container {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 30px;
    padding: 2rem;
    width: 100%;
    max-width: 1000px;
    background: var(--bg-dark-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--primary-blue-light);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(8px);
    transform-style: preserve-3d;
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

.asc-tower-view__node-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.asc-tower-view__exercise-node {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-small);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Node paths styling */
.asc-tower-view__node-path {
    height: 6px;
    width: 30px;
    background-color: var(--neutral-gray-light);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.asc-tower-view__path--completed {
    background-color: var(--success-green);
    box-shadow: 0 0 8px var(--shadow-blue);
}

/* Node States */
.asc-tower-view__node--completed {
    background: linear-gradient(to bottom, var(--success-green), var(--success-green-dark));
    border: 3px solid var(--success-green-light);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.asc-tower-view__node--current {
    background: linear-gradient(to bottom, var(--warning-amber), var(--warning-amber-dark));
    border: 3px solid var(--warning-amber-light);
    animation: pulse 2s infinite;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.asc-tower-view__node--available {
    background: linear-gradient(to bottom, var(--primary-blue), var(--primary-blue-dark));
    border: 3px solid var(--primary-blue-light);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.asc-tower-view__node--locked {
    background: linear-gradient(to bottom, var(--neutral-gray), var(--neutral-gray-dark));
    border: 3px solid var(--neutral-gray-light);
    cursor: not-allowed;
}

.asc-tower-view__node-icon {
    color: var(--text-primary);
    font-size: 32px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.asc-tower-view__exercise-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 120px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Assignment Blocker */
.asc-tower-view__assignment-blocker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.asc-tower-view__assignment-icon {
    color: var(--warning-amber);
    animation: pulse 2s infinite;
}

/* Description panel styling */
.asc-tower-view__description {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
    background: rgba(30, 64, 175, 0.6); /* Stronger blue background */
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px); /* Increased blur for better text contrast */
    font-style: italic;
    border-left: 4px solid var(--primary-blue-light);
    box-shadow: var(--shadow-small);
    position: relative;
    z-index: 1;
    color: white; /* Force white text for better contrast */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); /* Stronger text shadow */
    font-weight: 500; /* Slightly bolder text */
    line-height: 1.5; /* Better line spacing */
}

/* Game Bottom Navigation */
.asc-tower-view__bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    z-index: 10;
    border-top: 2px solid var(--glass-border);
    box-shadow: var(--shadow-up);
}

.asc-tower-view__nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 0;
    transition: color var(--transition-fast);
    font-size: 0.8rem;
}

    .asc-tower-view__nav-item:hover {
        color: var(--text-primary);
    }

.asc-tower-view__nav-icon-container {
    position: relative;
    margin-bottom: 4px;
}

.asc-tower-view__notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background-color: var(--error-red);
    color: white;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Loading State */
.asc-tower-view__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    position: relative;
    z-index: 1;
}

.asc-tower-view__spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 6px solid var(--primary-blue);
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.asc-tower-view__loading-text {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Error State */
.asc-tower-view__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

.asc-tower-view__error-icon {
    margin-bottom: 1rem;
}

.asc-tower-view__error-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.asc-tower-view__error-message {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    line-height: 1.4;
}

.asc-tower-view__error-actions {
    margin-top: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .asc-tower-view__floor-title {
        font-size: 1.2rem;
    }

    .asc-tower-view__nodes-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .asc-tower-view__exercise-node {
        width: 80px;
        height: 80px;
    }

    .asc-tower-view__node-icon {
        font-size: 24px;
    }
}

/* Invitation Notification - Toast Style (Following Level-Up Pattern) */
.asc-tower-view__invitation-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.asc-tower-view__invitation-notification.visible {
    transform: translateX(0);
    opacity: 1;
}

.asc-tower-view__invitation-content {
    background: linear-gradient(135deg, #1f43b9, #1e40af);
    border-radius: 12px;
    padding: 16px;
    color: white;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.asc-tower-view__invitation-content:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 6px 20px rgba(59, 130, 246, 0.3);
}

.asc-tower-view__invitation-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.asc-tower-view__invitation-text {
    flex: 1;
    min-width: 0;
}

.asc-tower-view__invitation-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1.2;
    color: white;
}

.asc-tower-view__invitation-message {
    font-size: 13px;
    opacity: 0.9;
    margin: 0 0 8px 0;
    line-height: 1.3;
    color: white;
}

.asc-tower-view__invitation-details {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    margin-top: 6px;
    backdrop-filter: blur(4px);
}

.asc-tower-view__invitation-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* Close button for toast */
.asc-tower-view__invitation-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.asc-tower-view__invitation-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

@media (max-width: 480px) {
    .asc-tower-view__content {
        padding: 10px;
    }

    .asc-tower-view__nav-item {
        font-size: 0.7rem;
    }

    .asc-tower-view__exercise-node {
        width: 60px;
        height: 60px;
    }

    .asc-tower-view__exercise-name {
        font-size: 0.8rem;
    }

    .asc-tower-view__invitation-notification {
        width: calc(100vw - 20px);
        right: 10px;
        top: 10px;
    }
    
    .asc-tower-view__invitation-content {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .asc-tower-view__invitation-icon {
        width: 32px;
        height: 32px;
        align-self: center;
    }

    .asc-tower-view__invitation-text {
        text-align: center;
    }

    .asc-tower-view__invitation-actions {
        justify-content: center;
        width: 100%;
    }
}
