/* =============================================================================
   SHARED STYLES — Agroteknologi UNINUS
   Digunakan oleh semua halaman sub-page.
   Konsistensi desain 100% dengan index.html.
============================================================================= */

:root {
    --uninus-green: #2e7d32;
    --uninus-green-dark: #1b5e20;
    --uninus-yellow: #f9a825;
    --bg-body: #ffffff;
    --bg-light: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --border-color: #eeeeee;
    --navbar-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-body: #121212;
    --bg-light: #1e1e1e;
    --bg-card: #252525;
    --text-main: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-color: #404040;
    --navbar-bg: #1a1a1a;
    --glass-bg: rgba(26, 26, 26, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.5);
}

[lang="ar"] {
    font-family: 'Amiri', serif;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-main);
    background-color: var(--bg-body);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
}

/* --- DARK MODE OVERRIDES --- */
[data-theme="dark"] .text-dark { color: var(--text-main) !important; }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .bg-white { background-color: var(--bg-card) !important; }
[data-theme="dark"] .bg-light { background-color: var(--bg-light) !important; }
[data-theme="dark"] .card { background-color: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .list-group-item { background-color: transparent; border-color: var(--border-color); color: var(--text-main); }
[data-theme="dark"] .dropdown-menu { background-color: var(--bg-card); border-color: var(--border-color); }
[data-theme="dark"] .dropdown-item { color: var(--text-main); }
[data-theme="dark"] .dropdown-item:hover { background-color: var(--bg-light); color: var(--uninus-green); }

a { text-decoration: none !important; transition: all 0.3s ease; }
img { max-width: 100%; height: auto; }

/* --- UTILITIES --- */
.bg-uninus-green { background-color: var(--uninus-green) !important; }
.text-uninus-green { color: var(--uninus-green) !important; }
.bg-gray-light { background-color: var(--bg-light) !important; }
.section-padding { padding: 80px 0; }
.tracking-widest { letter-spacing: 0.15em; }

.section-header { margin-bottom: 3rem; text-align: center; }
.section-header h2 { font-weight: 800; color: var(--uninus-green); position: relative; display: inline-block; font-size: 2.25rem; }
.section-header h2::after { content: ''; display: block; width: 60px; height: 4px; background: var(--uninus-yellow); margin: 10px auto 0; border-radius: 2px; }

/* --- NAVBAR --- */
.navbar { transition: all 0.4s; padding: 15px 0; background-color: var(--navbar-bg); z-index: 1030; font-size: 0.95rem; }
.navbar.scrolled { padding: 8px 0; background: var(--glass-bg) !important; box-shadow: 0 2px 10px var(--shadow-color); backdrop-filter: blur(10px); }
.dropdown-menu { border: none; box-shadow: 0 15px 40px var(--shadow-color); border-radius: 12px; margin-top: 10px; display: block; opacity: 0; visibility: hidden; transform: translateY(15px); transition: all 0.3s ease; font-size: 0.95rem; }
.nav-link { font-weight: 600; color: var(--text-main) !important; padding-right: 1.5rem !important; padding-left: 1.5rem !important; }
.nav-link:hover, .nav-link.active { color: var(--uninus-green) !important; }

.tools-btn { border: 1px solid var(--border-color); background: var(--bg-light); color: var(--text-main); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s; }
.tools-btn:hover { background: var(--uninus-green); color: white; border-color: var(--uninus-green); }

@media (min-width: 992px) {
    .nav-item:hover .dropdown-menu, .dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
    .navbar-tools { margin-left: 20px; }
}

@media (max-width: 991px) {
    .navbar-collapse { background-color: var(--navbar-bg); padding: 10px 20px; margin-top: 10px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid var(--border-color); max-height: 80vh; overflow-y: auto; }
    .navbar-tools { justify-content: center; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--border-color); width: 100%; }
    .dropdown-menu { display: none; opacity: 1; visibility: visible; transform: none; position: static; box-shadow: none; border: none; background-color: transparent; margin-top: 5px; padding-left: 15px; border-left: 2px solid var(--uninus-green); padding-bottom: 5px; }
    .dropdown-menu.show { display: block; }
}

/* --- COMPONENTS --- */
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
@media (min-width: 992px) {
    .hover-lift:hover { transform: translateY(-5px); box-shadow: 0 15px 30px var(--shadow-color) !important; border-color: var(--uninus-green); }
    .faculty-card:hover { transform: translateY(-10px); box-shadow: 0 25px 50px -12px var(--shadow-color); }
}

.faculty-card { border: 1px solid var(--border-color); border-radius: 20px; background: var(--bg-card); transition: all 0.4s; height: 100%; }

.stats-section { background-color: var(--uninus-green) !important; color: #ffffff !important; padding: 60px 0; position: relative; z-index: 10; }
.stat-item h2 { font-size: 3rem; font-weight: 800; margin-bottom: 0; color: #ffffff !important; }
.stat-item p { font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9; color: #ffffff !important; }

.news-card { border: 1px solid var(--border-color); border-radius: 15px; box-shadow: 0 5px 15px var(--shadow-color); height: 100%; display: flex; flex-direction: column; overflow: hidden; background-color: var(--bg-card); }
.news-img-wrapper { height: 200px; position: relative; overflow: hidden; flex-shrink: 0; }
.news-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
@media (min-width: 992px) { .news-card:hover img { transform: scale(1.1); } }

.date-badge { position: absolute; top: 15px; left: 15px; background: var(--uninus-yellow); padding: 5px 12px; border-radius: 20px; font-weight: 700; font-size: 0.85rem; z-index: 2; color: #000; }
.card-body { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.list-group-item { border: none; border-bottom: 1px solid var(--border-color); padding: 15px 0; display: flex; align-items: start; background: transparent; color: var(--text-main); }
.date-box { background: var(--uninus-green); color: white; padding: 5px 10px; border-radius: 8px; text-align: center; min-width: 60px; font-weight: bold; margin-right: 15px; }

/* --- FOOTER --- */
footer { background-color: var(--uninus-green); color: #fff; padding-top: 80px; }
.footer-title { color: white; font-weight: 700; margin-bottom: 25px; border-bottom: 3px solid var(--uninus-yellow); display: inline-block; padding-bottom: 10px; font-size: 1.25rem; }
.footer-link { color: #fff; display: block; margin-bottom: 10px; opacity: 0.8; font-weight: 500; }
.footer-link:hover { color: var(--uninus-yellow); padding-left: 5px; opacity: 1; }
.social-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.2); color: white; display: inline-flex; align-items: center; justify-content: center; margin-right: 10px; }
.social-btn:hover { background: var(--uninus-yellow); color: var(--uninus-green); }

/* --- PAGE HERO (Subpages) --- */
.page-hero {
    position: relative;
    padding: 120px 0 80px;
    background: url('https://images.unsplash.com/photo-1592982537447-6f2c6a0c5c36?auto=format&fit=crop&q=80&w=1920') center/cover no-repeat;
}
.page-hero .overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(27,94,32,0.9) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
}
.page-hero .container { position: relative; z-index: 2; }

/* --- WHATSAPP CHATBOX --- */
.wa-chatbox-container { position: fixed; bottom: 30px; right: 30px; z-index: 9999; font-family: 'Plus Jakarta Sans', sans-serif; }
.wa-widget-btn { width: 60px; height: 60px; border-radius: 50%; background-color: #25d366; color: white; border: none; font-size: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; animation: pulse-wa 2s infinite; outline: none; box-shadow: 0 4px 10px rgba(37,211,102,0.4); }
.wa-widget-btn:hover { background-color: #128C7E; transform: scale(1.1); }
.wa-chatbox { position: absolute; bottom: 80px; right: 0; width: 320px; background: #fff; border-radius: 15px; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease; transform-origin: bottom right; box-shadow: 0 10px 25px rgba(0,0,0,0.15); display: flex; flex-direction: column; }
.wa-chatbox.show { opacity: 1; visibility: visible; transform: translateY(0); }
.wa-chatbox-header { background: #006f3c; padding: 15px; display: flex; justify-content: space-between; align-items: center; }
.wa-avatar { position: relative; width: 40px; height: 40px; background: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; padding: 5px; }
.wa-avatar img { width: 100%; height: auto; border-radius: 50%; }
.online-dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; background: #25d366; border-radius: 50%; border: 2px solid #006f3c; }
.wa-chatbox-body { padding: 20px; background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); background-repeat: repeat; height: 200px; overflow-y: auto; }
.chat-message { background: #fff; padding: 10px 15px; border-radius: 0 12px 12px 12px; display: inline-block; max-width: 90%; position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.chat-message::before { content: ''; position: absolute; top: 0; left: -8px; border-top: 10px solid #fff; border-left: 10px solid transparent; }
.wa-chatbox-footer { padding: 15px; background: #f8f9fa; border-top: 1px solid #eee; text-align: center; }
.wa-start-chat-btn { display: block; background: #25d366; color: white; text-decoration: none; padding: 10px; border-radius: 25px; font-weight: 600; font-size: 0.9rem; transition: 0.3s; }
.wa-start-chat-btn:hover { background: #128C7E; color: white; }
@keyframes pulse-wa { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); } 70% { box-shadow: 0 0 0 15px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }
@media (max-width: 576px) { .wa-chatbox-container { bottom: 20px; right: 20px; } .wa-chatbox { width: 280px; right: -10px; } }

/* --- CONTENT CARDS --- */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    height: 100%;
}
.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--shadow-color);
    border-color: var(--uninus-green);
}

/* --- DATA TABLE --- */
.data-table { border-radius: 16px; overflow: hidden; margin-bottom: 0; border-collapse: collapse; }
.data-table thead th { background: rgba(46,125,50,0.06); color: var(--uninus-green-dark); font-weight: 800; padding: 18px 25px; border-bottom: 2px solid rgba(46,125,50,0.1); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }
.data-table tbody td { padding: 16px 25px; vertical-align: middle; border-bottom: 1px solid rgba(0,0,0,0.04); font-weight: 500; color: var(--text-main); transition: all 0.3s ease; }
.data-table tbody tr { transition: all 0.3s ease; }
.data-table tbody tr:hover { background-color: rgba(249,168,37,0.05); transform: scale(1.005); box-shadow: 0 4px 10px rgba(0,0,0,0.02); position: relative; z-index: 10; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* --- DOSEN CARD --- */
.dosen-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s;
    height: 100%;
}
.dosen-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow-color);
    border-color: var(--uninus-green);
}
.dosen-card .dosen-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s;
}
.dosen-card:hover .dosen-img {
    transform: scale(1.05);
}

/* --- FILTER TABS --- */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
}
.filter-tab {
    padding: 8px 24px;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}
.filter-tab:hover, .filter-tab.active {
    background: var(--uninus-green);
    color: white;
    border-color: var(--uninus-green);
}

/* --- SEARCH BOX --- */
.search-box {
    position: relative;
    max-width: 400px;
}
.search-box input {
    width: 100%;
    padding: 12px 20px 12px 50px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text-main);
    transition: all 0.3s;
}
.search-box input:focus {
    outline: none;
    border-color: var(--uninus-green);
    box-shadow: 0 0 0 4px rgba(46,125,50,0.1);
}
.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* --- BADGE STYLES --- */
.badge-green {
    background: rgba(46,125,50,0.1);
    color: var(--uninus-green);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
}
.badge-yellow {
    background: rgba(249,168,37,0.15);
    color: #e65100;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* --- TIMELINE --- */
.timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 30px;
    border-left: 3px solid var(--uninus-green);
}
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--uninus-green);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--uninus-green);
}
