:root {
    --ios-bg: #000000;
    --ios-text: #ffffff;
    --ios-secondary-text: #8e8e93;
    --ios-blue: #0a84ff;
    --ios-gray: #1c1c1e;
    --ios-separator: #38383a;
    --ios-navbar-bg: rgba(30, 30, 30, 0.85);
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
}

* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--ios-bg);
    color: var(--ios-text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: var(--ios-blue);
    text-decoration: none;
}

/* Base Layout */
.app-container {
    padding-bottom: 83px;
    min-height: 100vh;
    background: var(--ios-bg);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--ios-navbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: 12px;
    padding-left: 16px;
    padding-right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}

.header-title {
    color: #ffffff;
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    letter-spacing: 0.5px;
}

.header-button {
    background: none;
    border: none;
    color: #007AFF;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.3s;
}

.header-button.add-icon {
    font-size: 28px;
    font-weight: 300;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-button.unlocked {
    color: #34c759;
}

/* Photo Grid */
.photo-grid {
    padding-top: calc(60px + max(16px, env(safe-area-inset-top)));
    padding-bottom: 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
}

.photo-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.photo-item[data-status="locked"] {
    cursor: pointer;
}

.photo-content {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: filter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: filter, transform;
}

.photo-item[data-status="locked"] .photo-content {
    filter: blur(20px) brightness(0.7) saturate(0.5);
    transform: scale(1.2);
}

.photo-item[data-status="unlocked"] .photo-content {
    filter: blur(0px) brightness(1) saturate(1);
    transform: scale(1);
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.2);
    /* Opacity set to 20% */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.lock-overlay svg {
    width: 64px;
    /* Increased size */
    height: 64px;
    /* Increased size */
}

.photo-item[data-status="locked"] .lock-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.photo-item[data-status="unlocked"] .lock-overlay {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 84px;
    background-color: var(--ios-navbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: start;
    border-top: 0.5px solid rgba(255, 255, 255, 0.15);
    z-index: 50;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--ios-secondary-text);
    cursor: pointer;
}

.tab-item.active {
    color: var(--ios-blue);
}

.tab-label {
    font-size: 10px;
    font-weight: 500;
}