/* ========================================
   ARC 2.0 - Component Styles
   All UI Components with Gothic Elegance
   ======================================== */

/* Gallery Masonry */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
    padding: var(--space-xl) 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid var(--gray-medium);
    transition: all var(--transition-normal);
    cursor: pointer;
    background: var(--black-soft);
}

.gallery-item:hover {
    border-color: var(--green-primary);
    box-shadow: var(--shadow-green);
    transform: translateY(-8px);
}

.gallery-item-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-item-image {
    transform: scale(1.1);
}

.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    color: var(--white-pure);
}

.gallery-item-title {
    font-family: var(--font-elegant);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--white-pure);
}

.gallery-item-author {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--white-muted);
    font-style: italic;
    margin-bottom: var(--space-xs);
}

.gallery-item-stats {
    display: flex;
    gap: var(--space-md);
    font-size: 0.9rem;
}

.stats-likes {
    color: var(--green-light);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45, 80, 22, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.overlay-icon {
    font-size: 3rem;
    color: var(--white-pure);
}

/* Filters */
.section-filters,
.gallery-filters {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    margin: var(--space-lg) 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    background: transparent;
    border: 2px solid var(--gray-light);
    color: var(--white-muted);
    font-family: var(--font-elegant);
    font-size: 0.95rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--green-primary);
    color: var(--green-light);
    background: rgba(45, 80, 22, 0.15);
    box-shadow: 0 0 20px rgba(45, 80, 22, 0.3);
}

/* Audio Visualizer */
.audio-visualizer-container {
    width: 100%;
    height: 200px;
    border-radius: 16px;
    border: 3px solid var(--green-primary);
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(45, 80, 22, 0.12), var(--black-soft));
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-green);
}

.audio-visualizer {
    width: 100%;
    height: 100%;
}

/* Music Player */
.music-player-elegant {
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    padding: var(--space-xl);
    background: var(--gray-dark);
    border-radius: 20px;
    border: 3px solid var(--green-primary);
    box-shadow: var(--shadow-green);
}

.artwork-frame {
    width: 200px;
    height: 200px;
    margin: 0 auto var(--space-lg);
    border-radius: 50%;
    border: 4px solid var(--green-primary);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-green);
}

.artwork-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--green-dark), var(--gray-medium));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.artwork-vinyl {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--gray-medium), var(--black-soft));
    border: 2px solid var(--green-dark);
    position: relative;
}

.artwork-vinyl::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: var(--green-primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.player-info {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.track-title {
    font-family: var(--font-elegant);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white-pure);
    margin-bottom: var(--space-xs);
}

.track-artist {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--white-muted);
    font-style: italic;
}

.player-controls-elegant {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.control-btn-elegant {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--green-primary);
    background: transparent;
    color: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.control-btn-play {
    width: 70px;
    height: 70px;
}

.control-btn-elegant:hover {
    background: var(--green-primary);
    color: var(--white-pure);
    box-shadow: var(--shadow-green);
    transform: scale(1.1);
}

.player-timeline-elegant {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.time-current,
.time-total {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--green-light);
    min-width: 40px;
}

.timeline-track {
    flex: 1;
    height: 6px;
    background: var(--gray-medium);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
}

.timeline-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--green-dark), var(--green-light));
    border-radius: 10px;
    position: relative;
    transition: width 0.1s linear;
}

.timeline-handle {
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--green-light);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--green-primary);
}

/* Playlist */
.playlist-elegant {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-lg);
    background: var(--gray-dark);
    border-radius: 16px;
    border: 2px solid var(--green-primary);
}

.playlist-title {
    font-family: var(--font-elegant);
    font-size: 1.3rem;
    color: var(--white-pure);
    margin-bottom: var(--space-md);
    text-align: center;
}

.playlist-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--black-soft);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.playlist-item:hover,
.playlist-item.active {
    border-color: var(--green-primary);
    background: rgba(45, 80, 22, 0.12);
}

.playlist-number {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--green-light);
    font-weight: 700;
    min-width: 30px;
}

.playlist-info {
    flex: 1;
}

.playlist-title-text {
    font-family: var(--font-elegant);
    font-size: 1rem;
    color: var(--white-pure);
    margin-bottom: 4px;
}

.playlist-artist {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--white-dark);
    font-style: italic;
}

.playlist-duration {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--green-light);
}

/* Family Tree (D3.js container) */
.family-tree-container {
    width: 100%;
    min-height: 700px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 3px solid var(--green-primary);
    padding: var(--space-xl);
    overflow: auto;
    box-shadow: var(--shadow-green);
}

/* Quests */
.quests-container {
    padding: var(--space-xl) 0;
}

.quests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.quests-title {
    font-family: var(--font-elegant);
    font-size: 2rem;
    color: var(--white-pure);
}

.quests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.quest-card {
    position: relative;
    padding: var(--space-lg);
    background: var(--gray-dark);
    border: 2px solid var(--gray-light);
    border-radius: 16px;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.quest-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, var(--green-primary), var(--green-light), var(--green-primary));
    background-size: 200% 200%;
    opacity: 0;
    transition: opacity var(--transition-normal);
    animation: borderGlow 3s ease infinite;
}

.quest-card:hover {
    border-color: var(--green-primary);
    box-shadow: var(--shadow-green);
    transform: translateY(-5px);
}

.quest-card:hover::before {
    opacity: 0.1;
}

.quest-card-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.quest-icon-large {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: var(--space-md);
    filter: drop-shadow(0 0 10px var(--green-primary));
}

.quest-title {
    font-family: var(--font-elegant);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white-pure);
    text-align: center;
    margin-bottom: var(--space-sm);
}

.quest-description {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--white-muted);
    text-align: center;
    margin-bottom: var(--space-lg);
}

.quest-progress-container {
    margin-bottom: var(--space-lg);
}

.quest-progress-bar {
    height: 12px;
    background: var(--gray-medium);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-dark), var(--green-light));
    border-radius: 10px;
    transition: width 0.6s ease;
}

.quest-progress-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--green-light);
    text-align: center;
}

.quest-reward {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(45, 80, 22, 0.15);
    border-radius: 8px;
}

.reward-icon {
    font-size: 1.2rem;
}

.reward-text {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--white-muted);
    font-style: italic;
}

.quest-completed-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    padding: 6px 12px;
    background: var(--green-primary);
    color: var(--white-pure);
    font-family: var(--font-elegant);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 20px;
    box-shadow: var(--shadow-green);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-elegant {
    position: relative;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--gray-dark);
    border: 3px solid var(--green-primary);
    border-radius: 20px;
    padding: var(--space-xl);
    box-shadow: var(--shadow-green);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--green-primary);
    background: transparent;
    color: var(--green-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--green-primary);
    color: var(--white-pure);
    transform: rotate(90deg);
}

.work-modal-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.work-modal-image-container {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--green-primary);
}

.work-modal-image {
    width: 100%;
    height: auto;
    display: block;
}

.work-modal-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.work-modal-title {
    font-family: var(--font-elegant);
    font-size: 2rem;
    font-weight: 700;
    color: var(--white-pure);
}

.work-modal-author {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--white-muted);
}

.work-modal-author span {
    color: var(--green-light);
    font-style: italic;
}

.work-modal-description {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--white-muted);
    line-height: 1.6;
}

.work-modal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-light);
}

.meta-category {
    font-family: var(--font-elegant);
    font-size: 0.95rem;
    color: var(--green-light);
}

.btn-like {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--green-primary);
    border-radius: 30px;
    color: var(--green-light);
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-like:hover {
    background: var(--green-primary);
    color: var(--white-pure);
}

.work-modal-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: auto;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    font-family: var(--font-elegant);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-dark), var(--green-primary));
    color: var(--white-pure);
    border: 2px solid var(--green-light);
    box-shadow: var(--shadow-green);
}

.btn-primary:hover {
    box-shadow: 0 0 50px rgba(90, 143, 58, 0.8);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--green-light);
    border: 2px solid var(--green-primary);
}

.btn-secondary:hover {
    background: rgba(45, 80, 22, 0.15);
    border-color: var(--green-light);
    color: var(--green-accent);
}

/* ========================================
   Interactive World Map
   ======================================== */

.world-map-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 500px;
    margin: 2rem auto;
    border-radius: 20px;
    overflow: hidden;
}

.world-map-canvas {
    width: 100%;
    height: 100%;
}

.map-locations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.map-location {
    position: absolute;
    pointer-events: all;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.map-location:hover {
    transform: scale(1.1);
    z-index: 20;
}

.location-pulse {
    width: 50px;
    height: 50px;
    border: 3px solid;
    border-radius: 50%;
    position: relative;
    animation: pulsate 2s ease-in-out infinite;
    background: radial-gradient(circle at 30% 30%, rgba(90, 143, 58, 0.4), rgba(45, 80, 22, 0.2));
}

@keyframes pulsate {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

.location-pulse::before,
.location-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid;
    opacity: 0;
}

.location-pulse::before {
    width: 60px;
    height: 60px;
    animation: ripple 2s ease-out infinite;
}

.location-pulse::after {
    width: 80px;
    height: 80px;
    animation: ripple 2s 1s ease-out infinite;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.location-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    z-index: 5;
    pointer-events: none;
}

/* ========================================
   Interactive Guide Tour Styles
   ======================================== */

/* Tour Overlay */
.guide-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.guide-tour-overlay.active {
    pointer-events: all;
    opacity: 1;
}

/* Затемнение фона */
.guide-tour-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(3px);
}

/* Tour Info Panel - Основная панель с информацией */
.tour-info-panel {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98), rgba(26, 48, 16, 0.95));
    border: 3px solid var(--green-primary);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 
        0 10px 60px rgba(0, 0, 0, 0.8),
        0 0 80px rgba(45, 80, 22, 0.4),
        inset 0 1px 0 rgba(90, 143, 58, 0.2);
    z-index: 10001;
    pointer-events: all;
}

/* Progress Dots - Индикаторы прогресса */
.tour-progress {
    margin-bottom: 1.5rem;
    text-align: center;
}

.progress-dots {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    align-items: center;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(90, 143, 58, 0.2);
    border: 2px solid rgba(90, 143, 58, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.progress-dot.completed {
    background: var(--green-primary);
    border-color: var(--green-light);
    box-shadow: 0 0 10px rgba(90, 143, 58, 0.5);
}

.progress-dot.active {
    background: var(--green-accent);
    border-color: var(--green-light);
    transform: scale(1.4);
    box-shadow: 0 0 20px rgba(90, 143, 58, 0.8);
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(90, 143, 58, 0.8);
    }
    50% {
        box-shadow: 0 0 30px rgba(90, 143, 58, 1);
    }
}

/* Tour Content */
.tour-content {
    margin-bottom: 1.5rem;
    pointer-events: none;
}

.tour-title {
    font-family: var(--font-elegant);
    font-size: 2rem;
    color: var(--green-light);
    margin-bottom: 0.8rem;
    text-align: center;
    text-shadow: 0 0 20px rgba(90, 143, 58, 0.5);
}

.tour-description {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--white-soft);
    line-height: 1.7;
    margin-bottom: 0.8rem;
    text-align: center;
}

.tour-details {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--white-muted);
    line-height: 1.6;
    font-style: italic;
    text-align: center;
    opacity: 0.9;
}

/* Tour Controls */
.tour-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    pointer-events: all;
    position: relative;
    z-index: 10002;
}

.tour-btn {
    padding: 0.75rem 1.5rem;
    font-family: var(--font-elegant);
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--green-primary);
    background: rgba(45, 80, 22, 0.3);
    color: var(--green-light);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    pointer-events: all;
    user-select: none;
}

.tour-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(90, 143, 58, 0.3), transparent);
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    border-radius: 50%;
}

.tour-btn:hover::before {
    width: 200px;
    height: 200px;
}

.tour-btn:hover {
    background: rgba(45, 80, 22, 0.5);
    border-color: var(--green-light);
    color: var(--white-pure);
    box-shadow: 0 0 20px rgba(90, 143, 58, 0.4);
    transform: translateY(-2px);
}

.tour-btn:active {
    transform: translateY(0);
}

.tour-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.tour-btn-next {
    background: linear-gradient(135deg, var(--green-dark), var(--green-primary));
    border-color: var(--green-light);
    color: var(--white-pure);
    box-shadow: 0 4px 15px rgba(45, 80, 22, 0.3);
}

.tour-btn-next:hover {
    box-shadow: 0 6px 25px rgba(90, 143, 58, 0.5);
}

.tour-btn-skip {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

.tour-btn-skip:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

/* Highlight for Active Tab during Tour */
.nav-link.tour-highlight {
    position: relative;
    animation: tourHighlight 2s ease-in-out infinite;
}

@keyframes tourHighlight {
    0%, 100% {
        box-shadow: 0 0 20px rgba(90, 143, 58, 0.6);
    }
    50% {
        box-shadow: 0 0 40px rgba(90, 143, 58, 1), 0 0 60px rgba(90, 143, 58, 0.6);
    }
}

.nav-link.tour-highlight::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid var(--green-light);
    border-radius: 8px;
    animation: highlightPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes highlightPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-masonry {
        grid-template-columns: 1fr;
    }
    
    .quests-grid {
        grid-template-columns: 1fr;
    }
    
    .work-modal-wrapper {
        grid-template-columns: 1fr;
    }
    
    .music-player-elegant,
    .playlist-elegant {
        padding: var(--space-md);
    }
    
    .tour-info-panel {
        width: 95%;
        padding: 1.5rem;
        bottom: 1.5rem;
    }
    
    .tour-title {
        font-size: 1.5rem;
    }
    
    .tour-description {
        font-size: 1rem;
    }
    
    .tour-details {
        font-size: 0.9rem;
    }
    
    .tour-controls {
        flex-direction: column;
    }
    
    .tour-btn {
        width: 100%;
    }
}
