@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

@font-face {
    font-family: 'TamilMain';
    src: url('data/fonts/TAUMB.ttf') format('truetype');
}

:root {
    --primary: #c19a6b; /* Gold/Bronze */
    --primary-light: #e6c195;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
}

header {
    text-align: center;
    padding: 40px 0;
    animation: fadeInDown 0.8s ease-out;
}

header .logo {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    border-radius: 20%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
}

#main-search {
    width: 100%;
    padding: 15px 15px 15px 45px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
    transition: 0.3s;
    backdrop-filter: blur(10px);
}

#main-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(193, 154, 107, 0.3);
}

/* Main Navigation Buttons */
.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-large {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn-large:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.btn-large i {
    font-size: 2rem;
    color: var(--primary);
}

.btn-large span {
    font-weight: 600;
    font-size: 1.1rem;
}

/* List Views */
.view-section {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.view-section.active {
    display: block;
}

.list-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-light);
}

.card .title {
    font-weight: 500;
    flex: 1;
}

.card .arrow {
    color: var(--primary);
    font-size: 1.2rem;
}

/* Alphabet Filter */
.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.alpha-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.alpha-btn.active, .alpha-btn:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

/* Sermon Content View */
.sermon-view {
    padding-top: 20px;
}

.back-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.sermon-title {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 25px;
    line-height: 1.3;
}

.sermon-content {
    line-height: 1.8;
    font-size: 1.1rem;
    white-space: pre-wrap;
    text-align: justify;
}

.sermon-content b {
    color: var(--primary-light);
}

.action-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 40px;
    display: flex;
    gap: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 100;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: 0.2s;
    min-width: 60px;
}

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

.action-btn i {
    font-size: 1.5rem;
}

.action-btn span {
    font-size: 0.75rem;
    font-weight: 600;
}

/* PPT View */
#ppt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    background-size: cover;
    background-position: center;
}

#ppt-overlay .slide-content {
    font-family: 'TamilMain', serif;
    color: #fff;
    max-width: 90%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
    overflow: hidden;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-out;
}

#ppt-overlay .close-ppt {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2001;
}

/* Modal / Settings */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1e293b;
    width: 90%;
    max-width: 450px;
    border-radius: 20px;
    padding: 30px;
    position: relative;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    cursor: pointer;
    font-size: 1.5rem;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.setting-item select, .setting-item input[type="color"] {
    width: 100%;
    padding: 10px;
    background: #0f172a;
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 8px;
}

.save-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    border: none;
    color: #000;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
}

.tab-btn.active {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-container {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.editor-area {
    min-height: 250px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    overflow-y: auto;
    line-height: 1.6;
}

.editor-tools {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.editor-tools button {
    padding: 5px 12px;
    background: #334155;
    border: none;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.editor-tools button:hover {
    background: var(--primary);
    color: #000;
}

input[type="text"], input[type="file"] {
    width: 100%;
    padding: 12px;
    background: #0f172a;
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 8px;
    font-family: inherit;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 600px) {
    header h1 { font-size: 1.8rem; }
    .btn-large { padding: 15px; }
    .sermon-title { font-size: 1.4rem; }
}
