/* Recorder - Minimalistisches Design */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --light-gray: #ecf0f1;
    --border-color: #ddd;
    --star-color: #f39c12;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background-color: #fafafa;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* Container */
.container {
    max-width: 1200px;
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
}

.media-item {
    position: relative;
    transition: transform 0.2s ease;
}

.media-item:hover {
    transform: translateY(-4px);
}

.media-item a {
    text-decoration: none;
    color: inherit;
}

.media-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.2s ease;
}

/* Link-Cover im 1:1 Format */
.media-cover.link-cover {
    aspect-ratio: 1/1;
}

.media-cover:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.media-cover-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, var(--light-gray) 0%, #d5d8dc 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: #95a5a6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Link-Cover-Placeholder im 1:1 Format */
.media-cover-placeholder.link-cover {
    aspect-ratio: 1/1;
}

.media-info {
    margin-top: 8px;
}

.media-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-rating {
    margin-top: 4px;
}

/* Favorit Badge */
.favorite-badge {
    color: #e74c3c;
    font-size: 1.2rem;
}

/* URL-Overflow beheben */
.list-group-item a {
    word-break: break-all;
    overflow-wrap: break-word;
}

.list-group-item .text-muted.small {
    word-break: break-all;
    overflow-wrap: break-word;
}

/* Titel in Links-Liste umbrechen */
.list-group-item h5 {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Todo Items */
.todo-item {
    opacity: 0.6;
    position: relative;
}

.todo-item::after {
    content: "📌";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2rem;
}

.todo-toggle {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 10;
}

/* Sterne */
.stars {
    display: inline-flex;
    gap: 2px;
}

.star {
    fill: currentColor;
}

.star-full {
    color: var(--star-color);
}

.star-half {
    color: var(--star-color);
}

.star-empty {
    color: #ddd;
}

/* Interaktives Sterne-Rating (Formulare) */
.star-rating-input {
    display: inline-flex;
    gap: 4px;
    cursor: pointer;
}

.star-input {
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s;
}

.star-input:hover {
    transform: scale(1.1);
}

.star-input svg {
    fill: #ddd;
    transition: fill 0.2s;
}

.star-input.filled svg {
    fill: var(--star-color);
}

.star-input.half-filled svg {
    fill: url(#half-star-gradient);
}

/* Gradient für halbe Sterne */
#half-star-gradient {
    --star-fill: var(--star-color);
    --star-empty: #ddd;
}

/* Tags / Hashtags */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--light-gray);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.tag:hover {
    background-color: var(--accent-color);
    color: white;
}

.tag .badge {
    font-size: 0.75rem;
}

.tag-cloud-large {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.tag-size-1 { font-size: 0.9rem; }
.tag-size-2 { font-size: 1.1rem; }
.tag-size-3 { font-size: 1.3rem; }
.tag-size-4 { font-size: 1.5rem; }
.tag-size-5 { font-size: 1.8rem; }

/* Tagebuch */
.diary-list {
    max-width: 900px;
}

.diary-date {
    color: var(--secondary-color);
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.1rem;
}

.diary-day-group {
    background-color: white;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.diary-entry {
    border-bottom: 1px solid var(--light-gray);
    transition: background-color 0.2s ease;
}

.diary-entry:last-child {
    border-bottom: none;
}

.diary-entry:hover {
    background-color: var(--light-gray);
}

.diary-entry .badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.diary-entry .favorite-badge {
    color: #e74c3c;
    font-size: 1rem;
}

/* Links-Liste */
.list-group-item {
    background-color: white;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    border-radius: 4px;
    transition: box-shadow 0.2s ease;
}

.list-group-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Link-Vorschaubild im 1:1 Format */
.link-preview-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Link-Vorschau Platzhalter */
.link-preview-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--light-gray) 0%, #d5d8dc 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #95a5a6;
}

/* Detail-Seite */
.content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.content p {
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    margin-top: 50px;
    background-color: var(--light-gray);
    border-top: 1px solid var(--border-color);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* Pagination */
.pagination .page-link {
    color: var(--accent-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Formulare */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Toggle Switch */
.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.form-switch .form-check-label {
    cursor: pointer;
    margin-left: 0.5rem;
}

/* Hashtag-Input mit Tag-Anzeige */
.hashtag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 42px;
    cursor: text;
    background-color: white;
}

.hashtag-container:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.hashtag-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 3px;
    font-size: 0.9rem;
}

.hashtag-tag .remove {
    cursor: pointer;
    font-weight: bold;
    margin-left: 4px;
}

.hashtag-tag .remove:hover {
    color: #e74c3c;
}

.hashtag-input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    padding: 4px;
    font-size: 1rem;
}

/* Autocomplete Wrapper */
.autocomplete-wrapper {
    position: relative;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    width: 100%;
    margin-top: 2px;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: var(--light-gray);
}

.autocomplete-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.autocomplete-item:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .media-title {
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Animationen */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.media-item,
.diary-entry,
.list-group-item {
    animation: fadeIn 0.3s ease;
}
