:root {
    --ios-blue: #007AFF;
    --mac-bg: #F5F5F7;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --border-color: rgba(0, 0, 0, 0.1);
    --apple-easing: cubic-bezier(0.22, 1, 0.36, 1);
    --text-main: #1d1d1f;
    --text-soft: #86868b;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    cursor: default;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #d2d2d7 100%);
}


.finder-window {
    width: 90vw;
    height: 85vh;
    background: var(--mac-bg);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: windowOpen 0.5s var(--apple-easing);
}

.window-header {
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(245, 245, 247, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.window-controls {
    display: flex;
    gap: 8px;
    width: 100px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.close {
    background: #FF5F57;
}

.minimize {
    background: #FEB124;
}

.maximize {
    background: #28C940;
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.crumb {
    color: var(--text-soft);
    cursor: pointer;
}

.crumb.active {
    color: var(--text-main);
}

.crumb:not(:last-child):after {
    content: '>';
    margin-left: 8px;
    color: #ccc;
}

.header-btn {
    background: transparent;
    border: none;
    color: var(--ios-blue);
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}


.window-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-color);
    padding: 24px 12px;
}

.sidebar li {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 4px;
    transition: background 0.2s var(--apple-easing);
}

.sidebar li.active {
    background: rgba(0, 0, 0, 0.05);
    font-weight: 600;
}


.content-area {
    flex: 1;
    padding: 48px;
    overflow-y: auto;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 56px;
}

.item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s var(--apple-easing);
}

.item:hover {
    transform: translateY(-5px);
}

.item:active {
    transform: scale(0.92);
}

.icon {
    width: 110px;
    height: 110px;
    margin-bottom: 14px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}


.folder-icon {
    background-image: url('folder.png');
    background-color: transparent !important;
}

.file-icon {
    background-color: #fff;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.file-label {
    font-size: 1.05rem;
    color: var(--text-main);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.photo-viewer {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(40px) saturate(180%);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s var(--apple-easing);
}

#viewer-img {
    max-width: 85%;
    max-height: 80%;
    border-radius: 20px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.15);
    animation: alertScale 0.4s var(--apple-easing);
}

.viewer-close {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 1.2rem;
    color: var(--ios-blue);
    background: transparent;
    border: none;
    font-weight: 600;
}


.ios-alert {
    width: 270px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border-radius: 14px;
    display: none;
    flex-direction: column;
    animation: alertScale 0.25s var(--apple-easing);
}

.alert-content {
    padding: 20px;
    text-align: center;
}

.ios-input {
    width: 100%;
    margin-top: 15px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.alert-buttons {
    display: flex;
    border-top: 0.5px solid var(--border-color);
}

.alert-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--ios-blue);
    font-size: 1.1rem;
}

.alert-btn.primary {
    font-weight: 600;
    border-left: 0.5px solid var(--border-color);
}

.action-sheet {
    position: absolute;
    bottom: 20px;
    width: 90%;
    max-width: 400px;
    display: none;
    flex-direction: column;
    gap: 8px;
    animation: slideUp 0.3s var(--apple-easing);
}

.action-group {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border-radius: 14px;
    overflow: hidden;
}

.action-item {
    width: 100%;
    padding: 18px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--ios-blue);
    border-bottom: 0.5px solid var(--border-color);
}

.action-item.destructive {
    color: #FF3B30;
}


@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes alertScale {
    from {
        opacity: 0;
        transform: scale(1.1);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}