:root {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --accent-color: #4a5568;
    --border-color: #ddd;
    --bg-image: none;
    --bg-pattern: none;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: var(--bg-image), var(--bg-pattern);
    background-size: cover, auto;
    background-position: center, center;
    background-attachment: fixed, scroll;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: var(--accent-color);
}

nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 10px 25px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #2d3748;
    transform: translateY(-2px);
}

main {
    padding: 20px 0;
    min-height: 400px;
}

.poem-view {
    text-align: center;
}

.poem-view h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.poem-meta {
    font-style: italic;
    color: #666;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.poem-tags {
    margin: 10px 0 30px;
}

.share-buttons {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: 8px 16px;
    background: #e2e8f0;
    color: var(--accent-color);
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.share-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: #e2e8f0;
    border-radius: 15px;
    font-size: 0.85em;
    margin: 3px;
    color: var(--accent-color);
}

.poem-content {
    margin: 40px auto;
    max-width: 650px;
    font-size: 1.1em;
    line-height: 1.8;
    white-space: pre-wrap;
    text-align: left;
    display: inline-block;
    width: auto;
}

.poem-content-wrapper {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.poem-notes {
    margin: 40px auto 20px;
    max-width: 650px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
    text-align: left;
}

.poem-notes h4 {
    font-size: 1em;
    margin-bottom: 15px;
    color: var(--accent-color);
    font-weight: bold;
}

.poem-notes-content {
    white-space: pre-wrap;
}

.poem-content p {
    margin-bottom: 1.5em;
}

.poem-list {
    display: grid;
    gap: 20px;
}

.poem-item {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.poem-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.poem-item h3 {
    color: var(--accent-color);
    margin-bottom: 8px;
}

.poem-item .meta {
    font-size: 0.9em;
    color: #666;
}

footer {
    margin-top: 40px;
    padding: 30px 0;
    border-top: 2px solid var(--border-color);
}

.navigation-controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.control-btn {
    padding: 12px 30px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.control-btn:hover {
    background: #2d3748;
}

.admin-panel {
    max-width: 800px;
    margin: 0 auto;
}

.admin-panel h2 {
    margin-bottom: 20px;
    color: var(--accent-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--accent-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    font-size: 1em;
}

.form-group textarea {
    min-height: 300px;
    font-family: 'Georgia', 'Times New Roman', serif;
    resize: vertical;
}

.editor-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.editor-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.editor-btn:hover {
    background: #e2e8f0;
}

.editor-btn.active {
    background: var(--accent-color);
    color: white;
}

.btn-primary {
    padding: 12px 30px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #2d3748;
}

.btn-primary:disabled {
    cursor: not-allowed;
}

.btn-danger {
    padding: 8px 20px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 10px;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #c53030;
}

.admin-list {
    margin-top: 40px;
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 10px;
    background: white;
}

.admin-list-item h4 {
    color: var(--accent-color);
    margin-bottom: 5px;
}

.admin-list-item .meta {
    font-size: 0.85em;
    color: #666;
}

.settings-section {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.settings-section h3 {
    margin-bottom: 20px;
    color: var(--accent-color);
}

.color-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    cursor: pointer;
}

.message {
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    text-align: center;
}

.message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

kbd {
    background: #e2e8f0;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.9em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.temporary-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #48bb78;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-size: 1em;
    animation: slideUp 0.3s ease-out;
}

.temporary-message.fade-out {
    animation: fadeOut 0.3s ease-out;
    opacity: 0;
}

@keyframes slideUp {
    from {
        bottom: 0;
        opacity: 0;
    }
    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .poem-view h2 {
        font-size: 1.5em;
    }

    .poem-content {
        font-size: 1em;
        padding: 0 10px;
    }

    nav {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
    }

    .navigation-controls {
        flex-direction: column;
    }

    .control-btn {
        width: 100%;
    }

    .editor-toolbar {
        gap: 3px;
    }

    .editor-btn {
        padding: 6px 10px;
        font-size: 0.85em;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
    }

    .temporary-message {
        bottom: 20px;
        left: 10px;
        right: 10px;
        transform: none;
        width: calc(100% - 20px);
        text-align: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    .poem-content {
        font-size: 0.95em;
    }
}
