/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0;
    background-color: #fff;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5em;
    color: #2c3e50;
}

/* Posts */
.post {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.post-meta {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.post-content {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 20px;
}

.post-images {
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.post-images img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.post-audio {
    margin: 20px 0;
}

.post-audio audio {
    width: 100%;
    margin-bottom: 10px;
}

.no-posts {
    background: #fff;
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    font-size: 0.95em;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.85em;
}

.form-group textarea {
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

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

.btn-primary {
    background-color: #3498db;
}

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

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Back Link */
.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #3498db;
    text-decoration: none;
}

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

/* Admin Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    color: #2c3e50;
    font-size: 1.8em;
}

.admin-header nav a {
    margin-left: 15px;
    color: #3498db;
    text-decoration: none;
}

.admin-header nav a:hover {
    text-decoration: underline;
}

.admin-main {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-actions {
    margin-bottom: 30px;
}

.posts-list h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.posts-table {
    width: 100%;
    border-collapse: collapse;
}

.posts-table th,
.posts-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.posts-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.posts-table tr:hover {
    background-color: #f8f9fa;
}

.posts-table .actions {
    white-space: nowrap;
}

.posts-table .actions a {
    margin-right: 8px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    background-color: #ecf0f1;
    border-radius: 3px;
    font-size: 0.85em;
    margin-right: 5px;
}

/* Post Form */
.post-form {
    max-width: 800px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

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

.media-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.media-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
}

.media-item label {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    cursor: pointer;
}

.media-item input[type="checkbox"] {
    margin-right: 5px;
}

/* Audio List */
.audio-list {
    margin-top: 10px;
}

.audio-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
}

.audio-item audio {
    width: 100%;
    margin-bottom: 10px;
}

.audio-item label {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    cursor: pointer;
}

.audio-item input[type="checkbox"] {
    margin-right: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .post h2 {
        font-size: 1.5em;
    }
    
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-header nav {
        margin-top: 15px;
    }
    
    .admin-header nav a {
        margin: 0 10px;
    }
    
    .posts-table {
        font-size: 0.9em;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}
