*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f5f7;
    color: #111827;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.topbar-logo {
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    font-size: 0.9rem;
    color: #6b7280;
}

.topbar-logout-form {
    margin: 0;
}

.main-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

.content {
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.6rem;
}

.page-header .text-muted {
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    font-size: 0.9rem;
    padding: 0.55rem 1.3rem;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #111827;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-danger {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    padding: 0;
    cursor: pointer;
}

.btn-block {
    width: 100%;
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-text {
    font-size: 0.8rem;
    color: #6b7280;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.form-card {
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.text-muted {
    color: #6b7280;
}

.small {
    font-size: 0.8rem;
}

.empty-state {
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.album-card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.album-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.album-cover {
    height: 150px;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.album-cover-placeholder span {
    font-size: 2.5rem;
    font-weight: 600;
    color: #4b5563;
}

.album-info {
    padding: 0.9rem 1rem 1rem;
}

.album-info h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.card {
    background-color: #ffffff;
    border-radius: 1rem;
    margin-top: 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.card-header {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h2 {
    margin: 0;
    font-size: 1rem;
}

.card-body {
    padding: 1.25rem;
}

.upload-area {
    border-radius: 0.9rem;
    border: 1.5px dashed #9ca3af;
    padding: 1.5rem;
    text-align: center;
    background-color: #f9fafb;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-area.dragover {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-progress {
    margin-top: 0.75rem;
    height: 6px;
    border-radius: 999px;
    background-color: #e5e7eb;
    overflow: hidden;
}

.upload-bar {
    height: 100%;
    width: 0;
    background-color: #2563eb;
    transition: width 0.1s linear;
}

.upload-messages {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.hidden {
    display: none;
}

.photo-grid {
    column-count: 4;
    column-gap: 0.75rem;
}

@media (max-width: 1024px) {
    .photo-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .photo-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        column-count: 1;
    }
}

.photo-item {
    break-inside: avoid;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
}

.photo-item img {
    width: 100%;
    display: block;
}

.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 9999;
}

.lightbox-backdrop.hidden {
    display: none;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.lightbox-media img,
.lightbox-media video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    background-color: #000000;
}

.lightbox-controls {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.lightbox-button {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background-color: rgba(15, 23, 42, 0.7);
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    font-size: 1.2rem;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.lightbox-button:hover {
    background-color: rgba(15, 23, 42, 0.9);
    transform: scale(1.05);
}

.lightbox-button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.lightbox-button-close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
}

.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.auth-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    text-align: center;
}
