@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Tagalog&family=Noto+Sans+Hanunoo&family=Noto+Sans+Buhid&family=Noto+Sans+Tagbanwa&display=swap');

.font-baybayin, .font-baybayin * { font-family: 'Noto Sans Tagalog', sans-serif !important; }
.font-hanunoo, .font-hanunoo * { font-family: 'Noto Sans Hanunoo', sans-serif !important; }
.font-buhid, .font-buhid * { font-family: 'Noto Sans Buhid', sans-serif !important; }
.font-tagbanwa, .font-tagbanwa * { font-family: 'Noto Sans Tagbanwa', sans-serif !important; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans Tagalog", sans-serif;
    background: #fdfdfd;
}

/* Ensure the font applies to all elements inside the audit table and search results */
.audit-table, .audit-table td, .suggestions-list, .suggestions-list div, #catInput {
    font-family: 'Noto Sans Tagalog', -apple-system, sans-serif !important;
}

.output-box, .script-char {
    line-height: 2 !important; 
    font-variant-ligatures: normal !important;
    font-feature-settings: "kern", "liga", "mark", "mkmk" !important;
    -webkit-font-smoothing: antialiased;
    font-variant-ligatures: none !important;
    font-kerning: normal !important;
    unicode-bidi: isolate;
    white-space: nowrap;

    text-combine-upright: none;
}


/* LAYOUT */
.app-container { 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

/* HEADER */
.main-header { 
    display: flex; 
    background: #1e272e; 
    color: white; 
    padding: 20px 30px; 
    border-bottom: 4px solid #ffa502; 
    gap: 40px; 
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 0px;
}

.brand-box { text-align: center; min-width: 160px; border-right: 1px solid #34495e; padding-right: 30px; }
#script-title { font-family: 'Noto Sans Tagalog', sans-serif !important; font-size: 2.2rem; color: #fff; margin: 5px 0; }
.latin-title { font-weight: 900; letter-spacing: 3px; font-size: 1.3rem; color: #ffa502; }
.project-description { font-size: 0.9rem; line-height: 1.5; color: #ced4da; max-width: 900px; }

.header-nav {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    flex-shrink: 0;
    padding: 20px 50px;
    background-color: #1e272e;
}

.nav-btn {
    text-decoration: none;
    color: #e3ebf1; 
    padding: 10px 20px; 
    border: 1px solid #ffa502;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.nav-btn:hover, 
.nav-btn.active {
    background: #ffa502;
    color: #1e272e;
}

.section-header {
    padding: 0 10px;      
    margin-bottom: 25px;   
}

.page-main-title {
    font-size: 1.8rem;
    color: #1e272e;        
    margin-bottom: 5px;
    border-left: 5px solid #ffa502; 
    padding-left: 15px;
}

.page-subtitle {
    font-size: 1rem;
    color: #6c757d;        
    margin-top: 0;
    padding-left: 20px;    
}

/* Dashboard & Sidebar */
.dashboard { 
    display: flex; 
    flex-grow: 1; 
    overflow: visible; 
    background: #fdfdfd; 
    margin-bottom: 30px; 
}

.sidebar {
    width: 40%;
    background: #d1d8e0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    gap: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
}

textarea#latinInput {
    width: 100%;
    min-height: 60px; 
    max-height: 80px; 
    padding: 12px;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1.1rem;
    border: 1px solid #34495e;
}

.output-box {
    width: 100%;
    min-height: 80px; 
    max-height: 80px; 
    background-color: #2f3542; 
    color: #ffffff; 
    padding: 12px;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1.8rem; 
    border: 2px solid #34495e; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    overflow-y: auto;
}

/* Keyboard */
.keyboard { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 4px; 
    background: #a5b1be; 
    padding: 10px;
    border-radius: 8px;
    margin-top: 20px;
}

.keyboard button {
    height: 45px;
    background: #4b6584;
    color: white;
    border: none;
    transition: transform 0.1s;
    cursor: pointer;
}

.keyboard button:hover {
    background: #ffa502;
    transform: scale(1.05);
}

/* Main Content */
.main-content { width: 70%; padding: 30px; overflow-y: auto; background: #f1f2f6; }

.search-section {
    display: flex;
    gap: 12px;
    align-items: center; 
    width: 100%;
    max-width: 600px;   
}

.autosuggest-container {
    position: relative;
    flex: 3; 
}

#catInput { 
    width: 100%; 
    padding: 12px; 
    font-size: 1.2rem; 
    border: 2px solid #ddd; 
    border-radius: 6px; 
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#catInput:focus {
    outline: none;
}

.analyze-btn {
    flex: 1; 
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: #779d80; 
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap; 
}

.analyze-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.suggestions-list { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    width: 100%; 
    background: #f8f9fa; 
    border: 1px solid #ffa502; 
    z-index: 1000; 
    max-height: 250px; 
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.suggestions-list div { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #e9ecef; color: #2c3e50; font-size: 1rem; }
.suggestions-list div:hover { background: #ffa502; color: #ffffff; }

/* Table Styling */
.audit-table { 
    width: 80%; 
    background: #fff; 
    border-collapse: collapse; 
    border: 2px solid #34495e; 
    border-radius: 8px; 
    margin-top: 20px;
}

.audit-table th { 
    background: #687287; 
    color: #f8f8f8; 
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 5px;
    border: 1px solid #34495e; 
}

.audit-table td { padding: 12px; border: 1px solid #d1d8e0; text-align: center; color: #2c3e50; }
.audit-table td:first-child { text-align: left; font-weight: bold; background: #fdfdfd; }
.audit-table tr:hover { background-color: #f1f2f6; }

/* Footer */
.main-footer {
    background: #1e272e; 
    color: #ced4da;
    padding: 15px 30px;
    border-top: 2px solid #ffa502; 
    font-size: 0.85rem;
    flex-shrink: 0; 
}

.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-links a { color: #ffa502; text-decoration: none; margin: 0 5px; }
.footer-links a:hover { text-decoration: underline; }
.status-indicator { font-style: italic; color: #2ecc71; }

/* --- MOBILE STACKED LAYOUT --- */
@media screen and (max-width: 768px) {
    .main-header {
        flex-direction: column !important;
        text-align: center;
        padding: 20px 15px;
        gap: 20px;
    }

    .brand-box {
        border-right: none !important; 
        padding-right: 0 !important;
        border-bottom: 1px solid #34495e; 
        padding-bottom: 15px;
        width: 100%;
    }

    .project-description {
        max-width: 100%;
        font-size: 0.85rem;
    }

    .dashboard {
        flex-direction: column !important;
    }

    .sidebar, 
    .main-content {
        width: 100% !important;
        box-sizing: border-box;
    }

    .sidebar {
        position: relative !important;
        height: auto !important; 
        border-right: none;
        border-bottom: 2px solid #b2bec3;
        padding: 20px;
    }

    .keyboard {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .search-section {
        flex-direction: column !important;
        width: 100%;
    }

    .autosuggest-container {
        width: 100% !important;
    }

    .audit-table {
        width: 100% !important;
    }

    .table-container {
        overflow-x: auto;
        display: block;
        width: 100%;
    }
}