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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-bottom: 120px; /* space for bottom nav */
}

.tab-content {
    width: 100%;
    max-width: 500px;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.title {
    font-size: 28px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 30px;
    text-align: center;
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: none;
    border-bottom: 2px solid #e2e8f0;
    background-color: transparent;
    color: #2d3748;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-bottom-color: #667eea;
}

.search-input::placeholder {
    color: #a0aec0;
}

.results {
    margin-top: 20px;
    min-height: 50px;
}

.result-item {
    padding: 15px;
    font-size: 18px;
    color: #4a5568;
    background-color: #f7fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background-color 0.2s;
}

.result-item:hover {
    background-color: #edf2f7;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #a0aec0;
    font-size: 16px;
}

.loading {
    padding: 15px;
    text-align: center;
    color: #a0aec0;
    font-size: 16px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    padding: 12px 8px 16px;
    gap: 8px;
}

.nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #7a8696;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-item:visited {
    color: #7a8696;
}

.nav-item:hover,
.nav-item:focus {
    color: #4a5568;
}

.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.image-modal.hidden {
    display: none;
}

.image-modal:not(.hidden) {
    display: flex;
}

.image-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.image-modal__content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
}

.image-modal__content img {
    max-width: 80vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal__caption {
    text-align: center;
    color: #4a5568;
    font-weight: 600;
}

.image-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: #edf2f7;
    color: #4a5568;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal__close:hover {
    background: #e2e8f0;
}

.hidden {
    display: none !important;
}

.nav-item.active {
    color: #4a5568;
    font-weight: 600;
}

.tab-header {
    text-align: center;
    margin-bottom: 20px;
}

.tab-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #4a5568;
}

.tab-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.tab-image-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.photo-share__header h2 {
    font-size: 20px;
    color: #4a5568;
    text-align: center;
    margin-bottom: 4px;
}

.photo-share__header p {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.photo-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.photo-card img,
.photo-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 1;
}

.photo-card--placeholder {
    background: #e5e7eb;
    color: #9ca3af;
    font-size: 20px;
}

.photo-share__upload {
    border: none;
    background: #7b2e2e;
    color: #ffffff;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.photo-share__upload:hover {
    background: #6a2626;
}

.photo-share__refresh {
    margin-top: 6px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #4a5568;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.photo-share__refresh:hover {
    background: #eef2f6;
}

.photo-share__note {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.media-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.media-modal.hidden {
    display: none;
}

.media-modal:not(.hidden) {
    display: flex;
}

.media-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.media-modal__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mediaModalContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.media-modal__content img,
.media-modal__content video {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.media-modal__content video {
    background: #000;
}

.media-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.media-modal__close:hover {
    background: #ffffff;
}

@media (max-width: 600px) {
    .tab-content {
        padding: 30px 20px;
        max-width: 94vw;
    }
    
    .title {
        font-size: 24px;
    }
    
    .bottom-nav {
        padding: 10px 6px 14px;
    }
    
    .tab-header h2 {
        font-size: 20px;
    }
}

