/* Khởi tạo & CSS Variables cho Material Design (Dark Theme) */
:root {
    --primary: #f44336; /* Màu đỏ mang phong cách đối kháng */
    --primary-variant: #d32f2f;
    --background: #121212;
    --surface: #1e1e1e;
    --on-primary: #ffffff;
    --on-background: #ffffff;
    --on-surface: #e0e0e0;
    --text-secondary: #aaaaaa;
    --divider: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--on-background);
    line-height: 1.5;
    padding-top: 64px; /* Tránh bị che bởi App Bar */
}

/* Material Elevations (Đổ bóng) */
.elevation-2 { box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12); }
.elevation-4 { box-shadow: 0 2px 4px -1px rgba(0,0,0,.2), 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12); }
.elevation-6 { box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12); }

/* App Bar */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface);
    z-index: 1000;
}

.app-bar-content {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 16px;
}

.app-bar-title {
    font-size: 20px;
    font-weight: 500;
    margin-left: 16px;
    flex-grow: 1;
}

.app-bar-actions {
    display: flex;
    gap: 8px;
}

/* Các nút bấm (Buttons) */
button {
    background: none;
    border: none;
    color: var(--on-surface);
    cursor: pointer;
    outline: none;
    position: relative;
    overflow: hidden;
}

.icon-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.btn {
    padding: 0 16px;
    height: 36px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.25px;
    transition: background-color 0.2s;
}

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

.btn-text:hover {
    background-color: rgba(244, 67, 54, 0.08);
}

/* Bố cục trang chính */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

.hero {
    margin-bottom: 32px;
}

.hero-title {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 8px;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Lưới thẻ (Cards Grid) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Thẻ (Material Card) */
.card {
    background-color: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);
}

.card-media {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #333;
}

.badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background-color: var(--primary);
    color: var(--on-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.card-content {
    padding: 16px;
    flex-grow: 1;
}

.card-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.combo-inputs {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid var(--primary);
}

.combo-inputs code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #e57373;
    font-weight: bold;
    letter-spacing: 1px;
}

.card-actions {
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--divider);
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--on-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s, transform 0.2s;
    z-index: 100;
}

.fab:hover {
    background-color: var(--primary-variant);
    transform: scale(1.05);
}

/* Hiệu ứng Ripple (Sóng) bằng CSS/JS */
.ripple .ripple-element {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    background-color: rgba(255, 255, 255, 0.3);
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Snackbar (Thông báo dạng Toast) */
#snackbar {
    visibility: hidden;
    min-width: 250px;
    background-color: #323232;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 14px;
    box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12);
}

#snackbar.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

/* =========================================
   NAVIGATION DRAWER (MENU TRƯỢT MATERIAL)
   ========================================= */

/* Lớp phủ mờ (Đen phía sau menu) */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1001; /* Cao hơn app-bar (1000) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Khung Menu trượt */
.nav-drawer {
    position: fixed;
    top: 0;
    left: -280px; /* Ẩn ra ngoài màn hình bên trái */
    width: 280px;
    height: 100vh;
    background-color: var(--surface);
    z-index: 1002; /* Cao nhất để đè lên overlay */
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);
    /* Hiệu ứng trượt Material (Cubic Bezier) */
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-drawer.open {
    left: 0; /* Trượt vào màn hình */
}

/* Phần Banner trên cùng của Menu */
.nav-header {
    padding: 24px 16px;
    /* Gradient đỏ đen hợp với Mortal Kombat */
    background: linear-gradient(135deg, var(--primary) 0%, #8b0000 100%);
    color: var(--on-primary);
}

.nav-title {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 500;
}

.nav-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

/* Danh sách link trong Menu */
.nav-menu {
    padding: 8px 0;
    overflow-y: auto;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--on-surface);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Trạng thái mục đang được chọn (Active) */
.nav-item.active {
    color: var(--primary);
    background-color: rgba(244, 67, 54, 0.12);
}

/* Icon của các mục */
.nav-item i {
    margin-right: 32px;
    color: var(--text-secondary);
}

.nav-item.active i {
    color: var(--primary);
}

/* Đường kẻ phân cách */
.nav-divider {
    height: 1px;
    background-color: var(--divider);
    margin: 8px 0;
}
/* =========================================
   THANH TÌM KIẾM (SEARCH BAR)
   ========================================= */

.search-bar-content {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 16px;
    background-color: var(--surface);
    width: 100%;
    animation: slideDown 0.2s ease-out forwards;
}

/* Khung nhập liệu tìm kiếm */
.search-input {
    flex-grow: 1;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--on-surface);
    font-size: 16px;
    margin: 0 8px;
    caret-color: var(--primary); /* Màu con trỏ chuột nhấp nháy */
}

/* Đổi màu chữ placeholder */
.search-input::placeholder {
    color: var(--text-secondary);
}

/* Hiệu ứng mượt khi mở thanh tìm kiếm */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.d-none{
    display: none;
}

/* =========================================
   MODAL (DIALOG) MATERIAL DESIGN
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0,7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: absolute;
    top: 70px;
    right: 10px;
    background-color: var(--surface);
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 0 24px 24px;
    color: var(--on-surface);
}

.modal-footer {
    padding: 8px;
    display: flex;
    justify-content: flex-end;
}

/* Kiểu chữ trong modal */
.profile-info { text-align: center; margin-bottom: 20px; }
.profile-icon { font-size: 64px; color: var(--primary); margin-bottom: 8px; }

/* Tiện ích xóa padding dưới */
.pb-0 {
    padding-bottom: 0 !important;
}
.text-decoration-none{
    text-decoration: none;
}

/* Results Container */
#resultsContainer{
   position: absolute;
   z-index: 90;
   top: 60px;
   left: 0px;
   width: 100%;
   height: calc(100vh - 60px);
   padding: 10px;
   justify-content: flex-start;
   flex-direction: column;    /* Ép các phần tử con xếp theo chiều dọc (xuống hàng) */
   gap: 10px;             
   flex-wrap: nowrap;
   overflow-y: auto;
   background: rgba(0, 0, 0, 0,8);
   backdrop-filter: blur(10px);
   -webkit-backdrop-filter: blur(10px);
}

.noResult{
  width: 100%;
  padding: 10px;
  min-height: 60px;
  font-size: 20px;
  background: linear-gradient(145deg, #1f1f1f, #141414); 
  border-radius: 10px;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
/* Thẻ nhân vật */
.char-card { 
  display: block;
  width: 100%;
  overflow-y: auto;
  min-height: 250px;
  border: 1px solid #333; 
  padding: 20px; 
  background: linear-gradient(145deg, #1f1f1f, #141414); 
  border-radius: 10px;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

/* Hiệu ứng di chuột vào thẻ nhân vật */
.char-card:hover {
  transform: translateY(-5px);
  border-color: #ffb700;
}

/* Tên nhân vật & Variation */
.char-card h3 {
  color: #fff;
  border-bottom: 2px solid #8b0000; /* Đỏ máu */
  padding-bottom: 10px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Tên Combo */
.combo-name { 
  color: #ffb700; 
  margin-top: 15px;
  margin-bottom: 5px;
  font-size: 1.1rem;
  display: block;
  width: 100%;
}

/* Khối hiển thị Nút bấm (Frame Data style) */
.inputs { 
  font-family: 'Courier New', Courier, monospace; 
  background-color: #000; 
  color: #00ffcc; /* Màu lục lam rực rỡ để dễ đọc nút */
  padding: 4px 8px; 
  border-radius: 4px;
  border: 1px solid #444;
  font-weight: bold;
  letter-spacing: 1px;
  display: inline-block;
  margin: 5px 0;
}

/* Mô tả combo */
.char-card p {
  line-height: 1.5;
  color: #b3b3b3;
  font-size: 0.95rem;
}

.material-icons {
    font-family: 'Material Icons' !important;
    text-transform: none !important;
    font-style: normal;
    font-weight: normal;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}
