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

body {
    font-family: system-ui, -apple-system, sans-serif;
    padding: 40px 20px;
    background: #f5f5f5;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

h1 {
    font-size: 24px;
    margin-bottom: 30px;
    color: #333;
}

.drop-zone {
    background: white;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.drop-zone:hover {
    border-color: #0066cc;
    background: #f9f9f9;
}

.drop-zone.dragging {
    border-color: #0066cc;
    background: #e6f2ff;
}

.drop-zone p {
    color: #666;
    font-size: 16px;
}

.files {
    margin-top: 20px;
}

.file-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.file-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.file-status {
    font-size: 12px;
    color: #666;
}

.file-status.uploading {
    color: #0066cc;
}

.file-status.success {
    color: #00aa00;
}

.file-status.error {
    color: #cc0000;
}

.progress {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

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

.qr-button {
    padding: 6px 12px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.qr-button:hover {
    background: #0052a3;
}

.qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.qr-modal.active {
    display: flex;
}

.qr-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    position: relative;
}

.qr-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-modal-close:hover {
    color: #000;
}

.qr-modal-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    word-break: break-all;
}

.qr-modal-code {
    margin: 20px auto;
    display: inline-block;
}

.qr-modal-url {
    font-size: 12px;
    color: #666;
    margin: 20px 0;
    word-break: break-all;
}

.qr-modal-copy {
    padding: 10px 20px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.qr-modal-copy:hover {
    background: #0052a3;
}

.qr-modal-copy.copied {
    background: #00aa00;
}

.gallery {
    margin-top: 40px;
}

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

.gallery-title-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gallery h2 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.bulk-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.select-all-checkbox {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.selected-count-badge {
    background: #0066cc;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.selected-count-badge.hidden {
    display: none;
}

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

.bulk-action-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bulk-action-button.primary {
    background: #0066cc;
    color: white;
}

.bulk-action-button.primary:hover:not(:disabled) {
    background: #0052a3;
}

.bulk-action-button.danger {
    background: white;
    color: #cc0000;
    border: 2px solid #cc0000;
}

.bulk-action-button.danger:hover:not(:disabled) {
    background: #fff5f5;
    border-color: #990000;
    color: #990000;
}

.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.date-group {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.date-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.date-header:hover {
    background: #e9ecef;
}

.date-header-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

.date-header-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.date-header-count {
    font-size: 14px;
    color: #666;
}

.date-select-all {
    margin-left: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.date-select-all:hover {
    background: rgba(0, 102, 204, 0.1);
    color: #0066cc;
}

.date-select-all input[type="checkbox"] {
    cursor: pointer;
}

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

.date-group.collapsed .date-images {
    display: none;
}

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.image-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 10;
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f0f0f0;
}

.gallery-info {
    padding: 15px;
}

.gallery-filename {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    word-break: break-all;
}

.gallery-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.gallery-actions {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
}

.gallery-actions-left {
    display: flex;
    gap: 8px;
}

.delete-button {
    padding: 6px 12px;
    background: #cc0000;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.delete-button:hover {
    background: #990000;
}

.delete-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.view-button {
    padding: 6px 12px;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.view-button:hover {
    background: #444;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Print styles */
@media print {
    .container {
        display: none;
    }
    .qr-modal {
        display: none;
    }
    .print-page {
        display: block !important;
        position: relative;
    }
}

.print-page {
    display: none;
    padding: 20px;
}

.print-qr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    page-break-inside: avoid;
}

.print-qr-item {
    text-align: center;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    page-break-inside: avoid;
}

.print-qr-item canvas {
    margin: 0 auto 15px;
}

.print-qr-filename {
    font-size: 12px;
    color: #333;
    word-break: break-all;
    margin-bottom: 10px;
}

.print-qr-url {
    font-size: 10px;
    color: #666;
    word-break: break-all;
}

@media (max-width: 640px) {
    .gallery h2 {
        font-size: 18px;
    }

    .gallery-header {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-title-row {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 12px;
    }

    .select-all-checkbox {
        font-size: 13px;
    }

    .bulk-actions-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .bulk-action-button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
        justify-content: center;
    }
}
