/**
 * Pixel Hunting Tours - Frontend Styles
 * Split-screen layout: 65% map (top/left) + 35% content (bottom/right)
 * Based on SPLIT_SCREEN_LAYOUT.md
 */

:root {
    --primary-green: #92E842;
    --dark-bg: #000000;
    --white: #ffffff;
    --gray-dark: #333333;
    --gray-light: #f5f5f5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.pht-tour-split {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--dark-bg);
    color: var(--white);
    overflow: hidden;
    height: 100vh;
}

/* SPLIT CONTAINER */
.pht-split-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* MAP SECTION - 65% (Top on mobile, Left on desktop) */
.pht-map-section {
    height: 65vh;
    position: relative;
    background: var(--gray-dark);
    flex-shrink: 0;
}

.pht-map-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    padding: 1rem;
}

.pht-back-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s;
    text-decoration: none;
    line-height: 1;
}

.pht-back-btn:hover {
    background: var(--primary-green);
    color: var(--dark-bg);
}

.pht-map-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.pht-map-wrapper iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block;
}

.pht-map-placeholder,
.pht-map-error {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-dark);
    color: #666;
    font-size: 1.2rem;
}

/* CONTENT SECTION - 35% (Bottom on mobile, Right on desktop) - SCROLLABLE */
.pht-content-section {
    height: 35vh;
    background: var(--dark-bg);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.pht-content-inner {
    padding: 1.5rem;
    max-width: 100%;
}

/* Loading */
.pht-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.pht-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(146, 232, 66, 0.2);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* SEGMENT LIST VIEW */
.pht-segment-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pht-segment-group {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border-left: 4px solid var(--primary-green);
}

.pht-segment-group[data-color="red"] { border-left-color: #ef4444; }
.pht-segment-group[data-color="green"] { border-left-color: #4ade80; }
.pht-segment-group[data-color="blue"] { border-left-color: #3b82f6; }
.pht-segment-group[data-color="purple"] { border-left-color: #a855f7; }
.pht-segment-group[data-color="orange"] { border-left-color: #f97316; }
.pht-segment-group[data-color="yellow"] { border-left-color: #fbbf24; }

.pht-segment-header {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pht-segment-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pht-segment-emoji {
    font-size: 1.5rem;
}

.pht-segment-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.pht-segment-stats {
    font-size: 0.85rem;
    color: #999;
    white-space: nowrap;
}

.pht-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
}

.pht-point-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.pht-point-card:hover {
    background: rgba(146, 232, 66, 0.15);
    border-color: var(--primary-green);
    transform: translateY(-2px);
}

.pht-point-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Segment colors for point numbers */
.pht-point-number.color-red {
    background: #FF4444;
    color: white;
}
.pht-point-number.color-green {
    background: #44FF44;
    color: #1a1a1a;
}
.pht-point-number.color-blue {
    background: #4444FF;
    color: white;
}
.pht-point-number.color-purple {
    background: #AA44FF;
    color: white;
}
.pht-point-number.color-orange {
    background: #FF8844;
    color: white;
}
.pht-point-number.color-yellow {
    background: #FFFF44;
    color: #1a1a1a;
}
.pht-point-number.color-grey {
    background: #999999;
    color: white;
}

.pht-point-label {
    font-size: 0.9rem;
    color: #ccc;
}

/* POINT DETAIL VIEW */
.pht-point-detail {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pht-point-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.pht-point-back {
    background: none;
    border: none;
    color: var(--primary-green);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.pht-point-header-info h2 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem 0;
}

.pht-point-segment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Action Buttons */
.pht-action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.pht-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    border: none;
}

.pht-btn-primary {
    background: var(--primary-green);
    color: var(--dark-bg);
}

.pht-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.pht-btn-primary:hover {
    background: #7bc933;
    transform: translateY(-1px);
}

.pht-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.pht-btn.active {
    background: rgba(146, 232, 66, 0.2);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

/* Hint/Answer Content */
.pht-hint-content,
.pht-answer-content {
    display: none;
}

.pht-hint-content.active,
.pht-answer-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pht-hint-text,
.pht-answer-address {
    padding: 1rem;
    background: rgba(146, 232, 66, 0.1);
    border-left: 3px solid var(--primary-green);
    border-radius: 4px;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.pht-answer-description {
    padding: 1rem 0;
    line-height: 1.7;
    color: #ddd;
}

/* Photo Thumbnails - 100x100px */
.pht-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, 100px);
    gap: 0.5rem;
    margin: 1rem 0;
}

.pht-photo-thumb {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.pht-photo-thumb:hover {
    transform: scale(1.05);
}

.pht-photo-thumb::after {
    content: '🔍';
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 1.2rem;
    opacity: 0.8;
}

.pht-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Photo Lightbox */
.pht-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pht-lightbox.active {
    display: flex;
}

.pht-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--primary-green);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.pht-lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

/* Desktop Split-Screen (Side-by-side) */
@media (min-width: 1024px) {
    .pht-split-container {
        flex-direction: row;
    }
    
    .pht-map-section {
        width: 65%;
        height: 100vh;
    }
    
    .pht-content-section {
        width: 35%;
        height: 100vh;
    }
    
    .pht-content-inner {
        padding: 2rem;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .pht-map-section {
        height: 60vh;
    }
    
    .pht-content-section {
        height: 40vh;
    }
}

/* Scrollbar */
.pht-content-section::-webkit-scrollbar {
    width: 8px;
}

.pht-content-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.pht-content-section::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

.pht-content-section::-webkit-scrollbar-thumb:hover {
    background: #7bc933;
}
