/* Base styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Header styles */
.main-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
    margin-bottom: 20px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    margin: 0;
    font-size: 24px;
}

.site-title a {
    color: #333;
    text-decoration: none;
}

.site-title a:hover {
    color: #007bff;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: #007bff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.main-nav a:hover {
    background-color: #e9ecef;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    color: #333;
}

/* Layout styles */
.cluster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.face-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.face-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background-color: #f9f9f9;
}

.face-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.cluster-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
    text-align: center;
}

.cluster-card h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.cluster-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.cluster-link:hover {
    background-color: #f0f0f0;
}

/* Button styles */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

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

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

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

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

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    float: right;
    margin-left: 10px;
}

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

/* Form styles */
.tag-form {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.tag-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

.tag-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.tag-btn:hover {
    background-color: #0056b3;
}

.tag {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 12px;
    margin-right: 5px;
}

.tag:hover {
    background-color: #0056b3;
}

.existing-tags {
    margin-top: 10px;
}

/* Pagination styles */
.pagination {
    margin: 20px 0;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #007bff;
}

.pagination a:hover {
    background-color: #f8f9fa;
}

.pagination .current {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
}

/* Grid layouts */
.clusters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

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

.tag-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
}

.tag-card a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

.tag-card a:hover {
    text-decoration: underline;
}

/* Cluster preview */
.cluster-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.cluster-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Delete confirmation */
.delete-confirmation {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
    border: 2px solid #dc3545;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 4px;
    margin: 15px 0;
}

.buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Info styles */
.cluster-info,
.face-info,
.tag-info {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.stats {
    color: #666;
    margin-top: 10px;
}

/* Headers */
.page-header,
.tag-header {
    margin-bottom: 30px;
}

.page-title,
.tag-title {
    color: #333;
}

/* Utilities */
.no-tags {
    text-align: center;
    color: #666;
    margin-top: 50px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #007bff;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}