* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

#auth-section {
    display: flex;
    gap: 20px;
    align-items: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    min-width: 250px;
}

.auth-form input {
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
}

.auth-form button {
    padding: 10px 20px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.auth-form button:hover {
    transform: translateY(-2px);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.user-info span {
    font-size: 14px;
}

.user-info button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-info button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.error-message {
    color: #ff4444;
    font-size: 12px;
    margin-top: 5px;
}

main {
    padding: 30px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.primary-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.primary-button:active {
    transform: translateY(0);
}

.results {
    margin-top: 20px;
    padding: 20px;
    border-radius: 6px;
    display: none;
}

.results.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

.results.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

.results.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    display: block;
}

.users-list {
    margin-top: 20px;
}

.user-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-card .user-details {
    flex: 1;
}

.user-card .user-details strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.user-card .user-details span {
    font-size: 12px;
    color: #666;
}

.user-card .admin-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.collections-list {
    margin-top: 20px;
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.collection-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.collection-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.collection-header h3 {
    color: #333;
    font-size: 20px;
    margin: 0;
}

.collection-info {
    margin-bottom: 20px;
}

.collection-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #555;
}

.collection-info strong {
    color: #333;
    margin-right: 8px;
}

.checklists-section,
.subsets-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h4 {
    color: #333;
    font-size: 16px;
    margin: 0;
}

.checklists-list,
.subsets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checklist-item,
.subset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.checklist-item span,
.subset-item span {
    color: #555;
    flex: 1;
}

.edit-button,
.add-button {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.edit-button:hover,
.add-button:hover {
    background: #5568d3;
}

.edit-button-small {
    padding: 4px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.edit-button-small:hover {
    background: #5568d3;
}

.delete-button-small {
    padding: 4px 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.delete-button-small:hover {
    background: #d32f2f;
}

.error {
    color: #f44336;
    padding: 10px;
    background: #ffebee;
    border-radius: 6px;
    margin: 10px 0;
}
