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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 0;
    color: #000000;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 400;
    color: #000000;
    letter-spacing: 0;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: border-color 0.15s ease;
    background: white;
    color: #000000;
}

.btn-primary {
    background: #000000;
    color: white;
    border-color: #000000;
}

.btn-primary:hover {
    background: #000000;
    border-color: #000000;
    opacity: 0.85;
}

.btn-secondary {
    background: white;
    color: #666;
    border-color: #ccc;
}

.btn-secondary:hover {
    background: white;
    border-color: #999;
}

main {
    padding: 32px;
}

.config-panel {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    margin-bottom: 32px;
}

.config-panel h2 {
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 400;
    color: #000000;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 400;
    color: #000000;
    font-size: 13px;
}

.form-group input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 13px;
    transition: border-color 0.15s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #000000;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

.loading {
    text-align: center;
    padding: 40px 20px;
}

.loading p {
    font-size: 13px;
    color: #666;
}

.spinner {
    border: 2px solid #e0e0e0;
    border-top: 2px solid #000000;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #ffffff;
    color: #c53030;
    padding: 12px;
    border-radius: 2px;
    margin-bottom: 24px;
    border: 1px solid #feb2b2;
    font-size: 13px;
    line-height: 1.5;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 0;
}

.gallery-item {
    position: relative;
    background: white;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.gallery-item:hover {
    border-color: #999;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-item .image-info {
    padding: 12px;
    background: white;
}

.gallery-item .image-title {
    font-weight: 400;
    color: #000000;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.gallery-item .image-size {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

.modal-info {
    padding: 12px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.modal-info h3 {
    margin-bottom: 6px;
    color: #000000;
    font-size: 13px;
    font-weight: 400;
}

.modal-info p {
    color: #666;
    font-size: 12px;
}

.close {
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.7);
    width: 28px;
    height: 28px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    line-height: 1;
}

.close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.hidden {
    display: none !important;
}

/* View toggle - in header */
.view-controls {
    margin-bottom: 0;
}

.view-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
}

.btn-toggle {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 13px;
    cursor: pointer;
    background: white;
}

.btn-toggle:first-child {
    border-radius: 2px 0 0 2px;
}

.btn-toggle:last-child {
    border-radius: 0 2px 2px 0;
    border-left: none;
}

.btn-toggle.active {
    background: #000;
    color: white;
    border-color: #000;
}

.btn-toggle:not(.active):hover {
    background: #f5f5f5;
}

/* Timeline panel */
.timeline-panel {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    padding: 20px;
    margin-bottom: 24px;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.timeline-time {
    font-size: 15px;
    font-weight: 500;
    color: #000;
    min-width: 220px;
    text-align: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: white;
    cursor: pointer;
}

.btn-icon:hover {
    background: #f0f0f0;
    border-color: #999;
}

.timeline-scrubber {
    width: 100%;
    height: 8px;
    margin-bottom: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 4px;
}

.timeline-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
}

.timeline-scrubber::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    border: none;
}

.timeline-hint {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Timeline view - images at current time */
.timeline-view {
    margin-top: 0;
}

.timeline-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.timeline-image-item {
    background: white;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.timeline-image-item:hover {
    border-color: #999;
}

.timeline-image-item img {
    width: 100%;
    height: 280px;
    object-fit: contain;
    display: block;
    background: #f5f5f5;
}

.timeline-image-label {
    padding: 10px 12px;
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-empty {
    padding: 40px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-name {
    font-weight: 400;
    font-size: 13px;
    color: #666;
}

@media (max-width: 768px) {
    header {
        padding: 16px;
    }

    header h1 {
        font-size: 1.25rem;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .gallery-item img {
        height: 200px;
    }

    main {
        padding: 16px;
    }

    .config-panel {
        padding: 16px;
    }
}

