:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --primary: #f43f5e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

/* Frontend Theme */
.frontend-body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* Header */
.main-header {
    background-color: var(--card-bg);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
}
.logo span {
    color: var(--primary);
}

.search-bar {
    display: flex;
    background: var(--bg-color);
    border-radius: 20px;
    padding: 5px 15px;
    width: 400px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    flex-grow: 1;
    padding: 8px;
    outline: none;
}

.search-bar button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

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

.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}
.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

/* Hero Section */
.hero {
    background: linear-gradient(to right, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.4)), url('https://images.unsplash.com/photo-1512820790803-83ca734da794?auto=format&fit=crop&q=80') center/cover;
    border-radius: 15px;
    padding: 60px 40px;
    margin: 30px 0;
}

.hero-content h2 {
    font-size: 40px;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #cbd5e1;
}

/* Grid */
.section-title {
    margin-bottom: 20px;
    font-size: 24px;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.story-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s;
}

.story-card:hover {
    transform: translateY(-5px);
}

.story-cover {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.story-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.play-overlay i {
    font-size: 40px;
    color: white;
}

.story-card:hover .play-overlay {
    opacity: 1;
}

.story-info {
    padding: 15px;
}

.story-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-info p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Story Detail */
.story-detail-container {
    margin-top: 40px;
    margin-bottom: 40px;
}

.story-detail-layout {
    display: flex;
    gap: 40px;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
}

.story-detail-left {
    flex: 0 0 300px;
}

.story-detail-cover {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.story-detail-right {
    flex: 1;
}

.story-detail-right h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.story-author {
    color: var(--text-muted);
    font-size: 18px;
    margin-bottom: 30px;
}

.audio-player-container {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.story-description h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.story-description p {
    color: #cbd5e1;
    line-height: 1.8;
}

/* Admin Styles */
.admin-body {
    background-color: #f1f5f9;
    color: #334155;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.login-container h2 {
    margin-bottom: 20px;
    text-align: center;
}

.admin-form .form-group {
    margin-bottom: 15px;
}

.admin-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
}

.admin-container {
    max-width: 1000px;
    margin: 40px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

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

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