@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;1,400&family=Playfair+Display:wght@700;900&display=swap');

:root {
    --bg-color: #fdfcf0;
    --text-color: #2b2b2b;
    --primary-color: #5d2e0a;
    --secondary-color: #8b4513;
    --accent-color: #bc6c25;
    --card-bg: #ffffff;
    --border-color: #e6dfc8;
    --shadow: 0 10px 30px rgba(93, 46, 10, 0.08);
    --status-chci: #fcc419;
    --status-precteno: #40c057;
    --status-nechci: #868e96;
}

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

body {
    font-family: 'Merriweather', serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(139, 69, 19, 0.03) 1px, transparent 0);
    background-size: 24px 24px;
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 80px;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

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

/* Profile Selector */
#profile-selector {
    text-align: center;
    padding-top: 50px;
}

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

.profile-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.profile-card .avatar {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Dashboard */
#dashboard {
    display: none;
}

.search-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.search-section .form-group {
    margin-top: 10px;
}

.search-section .form-group:first-child {
    margin-top: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--secondary-color);
    text-decoration: underline;
    cursor: pointer;
}

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

button.btn-admin {
    background: #fdfcf0;
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

button.btn-admin:hover {
    background: #f2eee0;
}

button.btn-admin.active {
    background: var(--secondary-color) !important;
    color: white !important;
    border-color: var(--secondary-color);
}

.admin-panel {
    background: #fff9db;
    border: 1px solid #ffd43b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

/* Sections */
.section {
    margin-bottom: 40px;
}

.author-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 8px solid var(--primary-color); /* Book spine effect */
    border-radius: 4px 12px 12px 4px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.author-card:hover {
    transform: translateX(5px);
}

.author-header {
    background: #f9f7f0;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.author-title-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

.author-actions {
    display: flex;
    gap: 5px;
    margin-right: 15px;
}

.author-header:hover {
    background: #f2eee0;
}

.author-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.author-content {
    padding: 10px 25px 25px 35px;
    display: none;
    border-top: 1px solid #f5f0e0;
    animation: slideDown 0.4s ease-out;
}

.author-card.expanded .author-content {
    display: block;
}

.author-card.expanded .author-header {
    background: #fdfcf0;
    border-bottom: 1px solid var(--border-color);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.category-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 30px 0 15px 0;
    padding: 6px 14px;
    border-radius: 4px 15px 15px 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
    border-left: 4px solid currentColor;
}

.category-title::before {
    font-size: 1rem;
}

/* Chci číst - Bookmark Gold */
.category-section:nth-child(1) .category-title { 
    background: linear-gradient(135deg, #fff9db 0%, #fff3bf 100%); 
    color: #e67700; 
    border-color: #fcc419;
}
.category-section:nth-child(1) .category-title::before { content: "⏳"; }

/* Přečteno - Bookmark Emerald */
.category-section:nth-child(2) .category-title { 
    background: linear-gradient(135deg, #ebfbee 0%, #d3f9d8 100%); 
    color: #2b8a3e; 
    border-color: #40c057;
}
.category-section:nth-child(2) .category-title::before { content: "✅"; }

/* Nechci číst - Bookmark Stone */
.category-section:nth-child(3) .category-title { 
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); 
    color: #495057; 
    border-color: #adb5bd;
}
.category-section:nth-child(3) .category-title::before { content: "✖️"; }

.category-section:first-child .category-title {
    margin-top: 15px;
}

.book-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.1s;
    border-radius: 4px;
}

.action-btn:hover {
    opacity: 1;
    background: rgba(0,0,0,0.05);
}

.action-btn:active {
    transform: scale(0.9);
}

.action-btn.delete:hover {
    color: #bc6c25;
}

.action-btn.edit:hover {
    color: var(--primary-color);
}

.book-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f2f2f2;
    gap: 10px;
}

.book-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.book-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
}

.book-item:last-child {
    border-bottom: none;
}

.book-status {
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    min-width: 110px;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.status-přečteno { background: #40c057 !important; color: white !important; border-color: #2b8e3d; }
.status-chci-číst { background: #fcc419 !important; color: black !important; border-color: #fab005; }
.status-nechci-číst { background: #868e96 !important; color: white !important; border-color: #495057; }

/* Styling options - limited support but helps in some browsers */
.book-status option {
    background: white;
    color: black;
}

/* Forms */
.form-group {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

input, select, button {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
}

input {
    flex-grow: 1;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

button:hover {
    background-color: var(--secondary-color);
}

button.secondary {
    background-color: var(--accent-color);
}

/* Tabs/Lists */
.tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.tab {
    white-space: nowrap;
    padding: 8px 16px;
    background: #eee;
    border-radius: 20px;
    cursor: pointer;
}

.tab.active {
    background: var(--primary-color);
    color: white;
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn-admin, .btn-logout {
        flex: 1;
        text-align: center;
        padding: 10px;
        font-size: 0.8rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .author-header h3 {
        font-size: 1.1rem;
    }

    .book-status {
        min-width: 90px;
        font-size: 0.75rem;
    }
}
