* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2 {
    margin-top: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-header h1 {
    margin-bottom: 0;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0055aa;
    text-decoration: none;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    text-decoration: none;
}

.inline-form {
    display: inline;
}

/* Gallery list */
.gallery-list {
    list-style: none;
    padding: 0;
}

.gallery-list li {
    background: white;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-info {
    flex: 1;
}

.gallery-info h3 {
    margin: 0 0 5px 0;
}

.gallery-info .meta {
    color: #666;
    font-size: 14px;
}

.gallery-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: #6c757d;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #5a6268;
}

.btn-icon.copied {
    background: #28a745;
}

.btn-icon[data-tooltip] {
    position: relative;
}

.btn-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 6px;
    padding: 4px 8px;
    background: #333;
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.btn-icon[data-tooltip]:hover::after,
.btn-icon[data-tooltip].show-tooltip::after {
    opacity: 1;
}

/* Image grid */
.image-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 0;
}

.image-header h2 {
    margin: 0;
}

.bulk-actions {
    display: flex;
    justify-content: flex-end;
    min-height: 34px;
}

.bulk-actions form.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    background: #ddd;
}

.image-item.selected {
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

.image-item .select-checkbox {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.image-item:hover .select-checkbox,
.image-item.selected .select-checkbox,
.image-item .select-checkbox:checked {
    opacity: 1;
    pointer-events: auto;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.image-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-item:hover .delete-btn {
    opacity: 1;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-top: 20px;
    background: white;
    transition: border-color 0.2s, background-color 0.2s;
}

.upload-zone.dragover {
    border-color: #0066cc;
    background: #f0f7ff;
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-zone label {
    cursor: pointer;
    color: #0066cc;
}

.upload-progress {
    margin-top: 15px;
}

.progress-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: #0066cc;
    width: 0;
    transition: width 0.3s;
}

/* Public gallery */
.gallery-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.gallery-header h1 {
    margin-bottom: 5px;
}

.gallery-header .date {
    color: #666;
}

.gallery-admin-btns {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
}

.pswp-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.pswp-gallery a {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
}

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

.pswp-gallery a:hover img {
    transform: scale(1.05);
}

/* Validation errors */
.validation-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 360px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

.login-card .form-group input[type="password"] {
    width: 100%;
    max-width: none;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.login-card .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.login-error {
    background: #fee;
    color: #c00;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}
