/* ===== FONTS ===== */
body {
    font-family: 'Noto Sans Sinhala', 'Noto Serif Sinhala', sans-serif;
    background-color: #f8f6f1;
    color: #2c2c2c;
    overflow-x: hidden;
}

/* ===== NAVBAR ===== */
#main-navbar {
    background-color: #1a1a2e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.search-input {
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 20px;
    width: 180px;
    transition: width 0.3s ease;
}

.search-input::placeholder { color: rgba(255,255,255,0.5); }

.search-input:focus {
    background-color: white;
    color: #333;
    width: 220px;
}

/* ===== BUTTONS ===== */
.btn-warning {
    background-color: #f5a623;
    border-color: #f5a623;
    color: #1a1a2e;
}

/* ===== FOOTER ===== */
.footer {
    background-color: #1a1a2e;
    color: #ccc;
}

.footer-link {
    color: #aaa;
    text-decoration: none;
}

.footer-link:hover { color: #f5a623; }

/* ===== CARDS ===== */
.story-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.story-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

/* ===== READING PAGE ===== */
.reading-content {
    font-family: 'Noto Serif Sinhala', serif;
    font-size: 1.15rem;
    line-height: 2.0;
    color: #1a1a1a;
    max-width: 720px;
    margin: 0 auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-x: hidden;
}

.reading-content * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.reading-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

.reading-content table {
    width: 100%;
    table-layout: fixed;
    word-break: break-word;
}

.reading-content pre,
.reading-content code {
    white-space: pre-wrap;
    word-break: break-all;
}

.reading-content ol,
.reading-content ul {
    padding-left: 1.5rem;
}

/* Font size controls */
.font-small  .reading-content { font-size: 0.95rem; }
.font-medium .reading-content { font-size: 1.15rem; }
.font-large  .reading-content { font-size: 1.35rem; }

/* ===== BADGES / TAGS ===== */
.genre-badge {
    background-color: #eee;
    color: #555;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-block;
}

.genre-badge:hover {
    background-color: #f5a623;
    color: #1a1a2e;
}

.active-badge {
    background-color: #f5a623 !important;
    color: #1a1a2e !important;
    font-weight: 600;
}

/* ===== ALERTS ===== */
.alert-success { border-left: 4px solid #28a745; }
.alert-danger  { border-left: 4px solid #dc3545; }
.alert-info    { border-left: 4px solid #17a2b8; }

/* ===== QUILL CONTENT DISPLAY ===== */
.ql-align-center  { text-align: center !important; }
.ql-align-right   { text-align: right !important; }
.ql-align-justify { text-align: justify !important; }
.ql-size-small    { font-size: 0.85rem !important; }
.ql-size-large    { font-size: 1.35rem !important; }
.ql-size-huge     { font-size: 1.75rem !important; }
.ql-indent-1      { padding-left: 2rem; }
.ql-indent-2      { padding-left: 4rem; }

/* ===== HOVER CARD ===== */
.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1) !important;
}

/* ===== DROPDOWN FIX ===== */
.navbar .dropdown-menu {
    margin-top: 8px;
    border-radius: 10px;
    border: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    min-width: 200px;
}

.navbar .dropdown-item {
    border-radius: 6px;
    margin: 2px 6px;
    width: calc(100% - 12px);
}

.navbar .dropdown-item:hover {
    background-color: #fff8ee;
    color: #f5a623;
}

/* ===== TIP BUTTON ===== */
.tip-btn {
    background: linear-gradient(135deg, #f5a623, #e8890a);
    color: #1a1a2e;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(245,166,35,0.4);
    transition: all 0.3s ease;
}

.tip-btn:hover {
    background: linear-gradient(135deg, #e8890a, #d4780a);
    color: #1a1a2e;
    box-shadow: 0 6px 20px rgba(245,166,35,0.6);
    transform: translateY(-2px);
}


/* ===== STORY PLACEHOLDER COVERS ===== */
.placeholder-cover {
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 0;
}

.placeholder-cover.type-story {
    background: linear-gradient(135deg, #f5a623 0%, #f07d00 100%);
}

.placeholder-cover.type-poem {
    background: linear-gradient(135deg, #9b59b6 0%, #6c3483 100%);
}

.placeholder-cover.type-novel {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.placeholder-cover .cover-icon {
    font-size: 2.5rem;
    color: rgba(255,255,255,0.9);
}

.placeholder-cover .cover-title {
    font-family: 'Noto Serif Sinhala', serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 0 12px;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Smaller placeholder for recommendations */
.placeholder-cover-sm {
    height: 130px;
}