/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #fafafa;
    color: #262626;
    min-height: 100vh;
}

/* Header avec titre centré */
.header {
    background: white;
    border-bottom: 1px solid #dbdbdb;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    justify-self: center;
}

.user-info {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 16px;
}

.quota-badge {
    background: #e0e0e0;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.btn-upload {
    background: #0095f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-upload:hover {
    background: #0084e0;
}

.auth-btn {
    background: #0095f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.auth-btn:hover {
    background: #0084e0;
}

.logout-btn {
    background: #f0f0f0;
    color: #262626;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.logout-btn:hover {
    background: #e0e0e0;
}

/* Masquer éléments en mode anonyme */
.auth-only {
    display: none;
}

/* Filters */
.filters {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px;
    display: flex;
    gap: 12px;
}

.filter-btn {
    background: white;
    border: 1px solid #dbdbdb;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn.active {
    background: #0095f6;
    color: white;
    border-color: #0095f6;
}

/* Gallery Grid */
.gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

.gallery-item {
    background: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.job-preview {
    width: 100%;
    aspect-ratio: 1;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.job-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.job-preview-placeholder {
    text-align: center;
    color: #8e8e8e;
}

.job-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.job-label {
    font-size: 14px;
    font-weight: 500;
}

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

.gallery-item-title {
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #8e8e8e;
    margin-top: 4px;
}

.permission-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.permission-badge.PRIVATE {
    background: #ffe0e0;
    color: #d93025;
}

.permission-badge.SHARED {
    background: #fff4e0;
    color: #f57c00;
}

.permission-badge.PUBLIC {
    background: #e0f7e0;
    color: #1e8e3e;
}

.permission-badge.COMPLETED {
    background: #e0f7e0;
    color: #1e8e3e;
}

/* Permission Select */
.permission-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dbdbdb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: white;
}

.permission-select:focus {
    outline: none;
    border-color: #0095f6;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    overflow: hidden;
}

.modal-image {
    max-width: 60vw;
    max-height: 90vh;
    object-fit: contain;
}

.modal-sidebar {
    width: 400px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #0095f6;
    color: white;
}

.btn-viewer {
    background: #9c27b0;
    color: white;
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #262626;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
}

/* Modal Share Users */
.share-modal-content {
    background: white;
    border-radius: 12px;
    width: 90vw;
    max-width: 500px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.share-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #dbdbdb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.share-modal-body {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-item:hover {
    background: #f9f9f9;
}

.user-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-email {
    font-size: 12px;
    color: #8e8e8e;
}

.share-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #dbdbdb;
    display: flex;
    gap: 12px;
}

.share-modal-footer button {
    flex: 1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #8e8e8e;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8e8e8e;
}

.empty-state h2 {
    font-size: 24px;
    margin-bottom: 8px;
}
