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

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #e8e8e8;
    color: #333;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: #fafafa;
    border-bottom: 1px solid #ccc;
}

.home-link {
    color: #4a90d9;
    text-decoration: none;
}

.home-link:hover {
    text-decoration: underline;
}

.header h1 {
    font-size: 18px;
    font-weight: normal;
}

#auth-status {
    margin-left: auto;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #fafafa;
    border-right: 1px solid #ccc;
    overflow-y: auto;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.sidebar-header h2 {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}

.album-tree {
    padding: 10px;
}

.album-item {
    margin-bottom: 2px;
}

.album-row {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    cursor: pointer;
    border: 1px solid transparent;
}

.album-row:hover {
    background: #eee;
    border-color: #ddd;
}

.album-row.active {
    background: #ddd;
    border-color: #ccc;
}

.album-toggle {
    width: 20px;
    color: #666;
    font-size: 12px;
}

.album-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-count {
    color: #888;
    font-size: 12px;
    margin-left: 5px;
}

.album-visibility {
    font-size: 10px;
    margin-left: 5px;
    padding: 1px 4px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
}

.album-visibility:hover {
    background: #eee;
}

.album-children {
    margin-left: 20px;
    display: none;
}

.album-children.expanded {
    display: block;
}

/* Content Area */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.ascii-art {
    font-size: 12px;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #555;
}

/* Album View */
.album-header {
    margin-bottom: 20px;
}

.album-header h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.album-description {
    color: #666;
    line-height: 1.6;
    max-width: 800px;
}

/* Sub Albums */
.sub-albums {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.sub-album {
    padding: 8px 15px;
    background: #fafafa;
    border: 1px solid #ccc;
    cursor: pointer;
}

.sub-album:hover {
    background: #eee;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.photo-item {
    aspect-ratio: 1;
    background: #ddd;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid #ccc;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.photo-item:hover img {
    transform: scale(1.05);
}

/* Admin Panel */
.admin-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #333;
    color: #ccc;
    font-size: 12px;
}

.admin-stats {
    display: flex;
    gap: 20px;
}

.admin-stat {
    display: flex;
    gap: 5px;
}

.admin-stat-label {
    color: #888;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    background: #fafafa;
    border: 1px solid #ccc;
    cursor: pointer;
}

.btn:hover {
    background: #eee;
}

.btn-danger {
    color: #c00;
}

.btn-danger:hover {
    background: #fdd;
}

.btn-secondary {
    background: #eee;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    padding: 20px 15px;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-image-container {
    max-width: 90%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-loading {
    color: #fff;
    position: absolute;
}

.lightbox-info {
    position: absolute;
    bottom: 20px;
    display: flex;
    gap: 20px;
    color: #fff;
    font-size: 14px;
}

.lightbox-original {
    color: #4a90d9;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fafafa;
    padding: 20px;
    border: 1px solid #ccc;
    min-width: 300px;
}

.modal-content h3 {
    margin-bottom: 15px;
}

.modal-content select {
    width: 100%;
    padding: 8px;
    font-family: inherit;
    margin: 10px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Loading */
.loading {
    color: #888;
    padding: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .admin-panel {
        flex-direction: column;
        gap: 10px;
    }
}
