/* FAMICOM Retro Styles - Base Styles */

/* Import Pixel Font */
@font-face {
    font-family: 'DungGeunMo';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/DungGeunMo.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body - FAMICOM Bright Background */
body {
    font-family: 'DungGeunMo', 'Press Start 2P', monospace;
    background: #f0e0c0;
    min-height: 100vh;
    color: #2c2c54;
    font-size: 14px;
    line-height: 1.8;
}

/* Navbar - FAMICOM 2-Tier Console */
.navbar {
    position: relative;
    border-top: 3px solid #ffcc00;
}

/* Top Bar - Dark slim bar */
.navbar-top {
    background: #2c2c54;
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
    border-bottom: 2px solid #1a1a3e;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    color: #ffcc00;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
    letter-spacing: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-brand::before {
    content: '⚔️ ';
}

/* Search Form */
.search-form {
    display: flex;
    border: 2px solid #444470;
    background: #1a1a3e;
    flex: 1;
    max-width: 300px;
    margin: 0 auto;
}

.search-input {
    padding: 0.35rem 0.5rem;
    border: none;
    background: #1a1a3e;
    color: #fff;
    width: 100%;
    font-family: 'DungGeunMo', monospace;
    font-size: 0.8rem;
}

.search-input::placeholder {
    color: #666688;
}

.search-input:focus {
    outline: none;
    background: #222248;
}

.search-btn {
    padding: 0.35rem 0.6rem;
    background: #444470;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.1s;
    font-family: 'DungGeunMo', monospace;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.search-btn:hover {
    background: #4488cc;
}

/* User Menu (top-right) */
.navbar-user {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-shrink: 0;
}

.navbar-user a {
    color: #8888aa;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    transition: color 0.1s;
    white-space: nowrap;
}

.navbar-user a:hover {
    color: #ffcc00;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    margin-left: auto;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #ffcc00;
    transition: all 0.2s;
}

/* Tab Menu - Red console bar */
.navbar-tabs {
    background: #e84040;
    padding: 0;
    display: flex;
    border-bottom: 4px solid #b02020;
    box-shadow: 0 3px 0 rgba(0,0,0,0.2);
}

.nav-tab {
    color: #ffcccc;
    text-decoration: none;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    transition: all 0.1s;
    position: relative;
    border-right: 1px solid #c03030;
}

.nav-tab:hover {
    background: #c03030;
    color: #fff;
}

.nav-tab.active {
    background: #fff8e8;
    color: #e84040;
    font-weight: bold;
}

.nav-tab.active::before {
    content: '▶ ';
    font-size: 0.7rem;
}

.nav-tab-admin {
    margin-left: auto;
    border-right: none;
    border-left: 1px solid #c03030;
    color: #ffcc00;
}

.nav-tab-admin:hover {
    color: #fff;
}

.nav-tab-admin.active {
    color: #e84040;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Flash Messages - FAMICOM Notifications */
.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 3px solid;
    background: #fff8e8;
    color: #2c2c54;
    position: relative;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
}

.flash::before {
    content: '▶ ';
    font-size: 0.8rem;
}

.flash.success {
    border-color: #44aa44;
    border-left: 4px solid #44aa44;
}

.flash.success::before {
    content: '✓ ';
}

.flash.error {
    border-color: #e84040;
    border-left: 4px solid #e84040;
}

.flash.error::before {
    content: '✗ ';
}

.flash.info {
    border-color: #4488cc;
    border-left: 4px solid #4488cc;
}

.flash.info::before {
    content: 'ℹ ';
}

.flash.warning {
    border-color: #ffaa00;
    border-left: 4px solid #ffaa00;
}

.flash.warning::before {
    content: '⚠ ';
}

/* Common Buttons - FAMICOM Style */
.btn {
    padding: 0.75rem 1.5rem;
    border: 3px solid;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.1s;
    min-height: 44px;
    font-family: 'DungGeunMo', monospace;
    font-weight: bold;
    text-align: center;
    position: relative;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    color: #fff;
}

.btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 rgba(0,0,0,0.25);
}

.btn:active {
    transform: translate(3px, 3px);
    box-shadow: none;
}

.btn-primary {
    background: #4488cc;
    border-color: #2c6090;
}

.btn-primary:hover {
    background: #3377bb;
}

.btn-secondary {
    background: #8888aa;
    border-color: #666688;
}

.btn-secondary:hover {
    background: #777799;
}

.btn-danger {
    background: #e84040;
    border-color: #b02020;
}

.btn-danger:hover {
    background: #d73030;
}

.btn-success {
    background: #44aa44;
    border-color: #2c882c;
}

.btn-success:hover {
    background: #339933;
}

/* Common Cards - FAMICOM Panels */
.card {
    background: #fff8e8;
    border: 4px solid #2c2c54;
    padding: 1.5rem;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #e84040;
    pointer-events: none;
}

/* Book Grid - RPG Item Grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1.2rem;
}

.book-card {
    background: #fff8e8;
    border: 4px solid #2c2c54;
    overflow: hidden;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
    transition: all 0.1s;
    cursor: pointer;
    position: relative;
}

.book-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    pointer-events: none;
    transition: border-color 0.1s;
}

.book-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.25);
}

.book-card:hover::after {
    border-color: #e84040;
}

.book-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    background: #4488cc;
}

/* Book Card Body - FAMICOM Style */
.book-card-body {
    padding: 1rem;
    background: #fff8e8;
}

.book-card-body h4,
.book-card-body .book-title {
    color: #e84040;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.book-card-body p,
.book-card-body .book-description {
    color: #555;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.book-card-body .book-stats,
.book-card-body .stats {
    font-size: 0.75rem;
    color: #666;
    opacity: 0.8;
}

.book-card-body .book-author {
    color: #666;
    font-size: 0.8rem;
}

/* Form Container - FAMICOM Dialog Box */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff8e8;
    border: 4px solid #2c2c54;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
    position: relative;
}

.form-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #e84040;
    pointer-events: none;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c2c54;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 3px solid #2c2c54;
    background: #fff;
    color: #2c2c54;
    font-size: 0.9rem;
    font-family: 'DungGeunMo', monospace;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4488cc;
    background: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #e84040;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.15);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* Links */
a {
    color: #4488cc;
    transition: color 0.1s;
}

a:hover {
    color: #e84040;
}

/* Text Selection */
::selection {
    background: #e84040;
    color: #fff;
}

/* Scrollbar - FAMICOM Style */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #e0d0b0;
    border: 2px solid #2c2c54;
}

::-webkit-scrollbar-thumb {
    background: #e84040;
    border: 2px solid #fff8e8;
}

::-webkit-scrollbar-thumb:hover {
    background: #d73030;
}
