/* Modern CSS Reset and Variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-card: #374151;
    --border-color: #4b5563;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    background-image: linear-gradient(135deg, rgba(30, 58, 138, 0.15) 0%, rgba(88, 28, 135, 0.15) 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.logo h1 {
    font-size: 1.25rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    /* Fallback/Override */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-weight: bold;
}

.logo h1 i {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    /* Prevent wrapping to keep in one line if preferred, or wrap if user wants multiple lines */
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
    /* Space for scrollbar if it appears (hidden by css but good for touch) */
}

nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    /* Add shadow on hover/active */
}

/* Hamburger Menu */
.hamburger-menu {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-menu span {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation */
.mobile-nav {
    display: flex;
    position: fixed;
    top: 0;
    left: -100%;
    width: 340px;
    height: 100vh;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1100;
    flex-direction: column;
    justify-content: flex-start;
    padding: 5rem 0 2rem 0;
    align-items: stretch;
    gap: 0;
    transition: left 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1rem 2rem;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mobile-nav-link:hover {
    background: rgba(37, 99, 235, 0.1);
}

.mobile-nav-link.active {
    background: rgba(37, 99, 235, 0.2);
    color: white;
}

.mobile-nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.close-mobile-nav {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-mobile-nav:hover {
    background: var(--primary-color);
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.9), rgba(88, 28, 135, 0.8));
    color: white;
    padding: 5rem 2rem;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Device Info */
.device-info {
    background: var(--bg-primary);
    padding: 4rem 2rem;
}

.device-info h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.spec-item {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.spec-item:hover {
    transform: translateY(-5px);
}

.spec-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.spec-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.spec-value {
    color: var(--text-secondary);
}

/* Installation Guide */
.installation-guide {
    background: var(--bg-secondary);
    padding: 4rem 2rem;
}

.installation-guide h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.step {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    position: relative;
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.guide-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.guide-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* FAQ Section */
.faq {
    padding: 4rem 2rem;
    background: var(--bg-primary);
}

.faq h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.faq-grid {
    max-width: 800px;
    margin: 2rem auto 0;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--bg-card);
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: var(--bg-card);
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer.active {
    max-height: 200px;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    margin: 0;
    color: var(--text-secondary);
}

/* Page Headers */
.page-header {
    text-align: center;
    padding: 3rem 0;
    color: white;
}

.page-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Filter Bar */
.filter-bar {
    background: rgba(31, 41, 55, 0.95);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ROMs Grid */
.roms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* ROM Card Layout */
.rom-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    align-items: start;
    grid-template-rows: auto auto auto;
}

.rom-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.rom-header {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
}

.rom-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.rom-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Screenshot Section */
.rom-screenshot-section {
    grid-column: 1;
    grid-row: 2;
}

.screenshot-square {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.screenshot-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.screenshot-square:hover img {
    transform: scale(1.05);
}

.screenshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    opacity: 0;
}

.screenshot-square:hover .screenshot-overlay {
    opacity: 1;
}

/* Content Section */
.rom-content-section {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

/* Compact Meta Information */
.rom-meta-compact {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
}

.meta-item-compact {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
}

.meta-item-compact i {
    font-size: 0.8rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.gapps-yes {
    color: var(--success-color);
}

.gapps-no {
    color: var(--error-color);
}

/* Action Buttons */
.action-buttons-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.4rem;
    flex: 0 0 auto;
    margin-top: auto;
}

.square-btn-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.3rem 0.2rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.65rem;
    text-align: center;
    min-height: 40px;
}

.square-btn-compact i {
    font-size: 0.8rem;
    margin: 0;
    line-height: 1;
}

.square-btn-compact.primary {
    background: var(--primary-color);
    color: white;
}

.square-btn-compact.secondary {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.square-btn-compact.telegram {
    background: #0088cc;
    color: white;
}

.square-btn-compact.donate {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.square-btn-compact:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Hide empty button slots */
.square-btn-compact.hidden {
    display: none;
}

/* Tabbed Sections */
.rom-tabs {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 1rem;
    flex: 0 0 auto;
}

.tab-headers {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-header {
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.8rem;
}

.tab-header.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content-rom {
    display: none;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.75rem;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.8rem;
}

.tab-content-rom.active {
    display: block;
}

.tab-content-rom ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.tab-content-rom li {
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tab-content-rom li:last-child {
    border-bottom: none;
}

/* No results styling */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.no-results i {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    position: relative;
}

#modal-image {
    width: 100%;
    height: 500px;
    object-fit: contain;
    background: var(--bg-secondary);
}

.modal-nav {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 25px;
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

#image-counter {
    color: white;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

/* Footer */
footer {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.footer-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.footer-link i {
    font-size: 1.2rem;
}

/* Guide Page Styles */
.guide-header {
    text-align: center;
    padding: 3rem 0;
    color: white;
}

.guide-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.guide-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.guide-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.guide-content {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}

/* Warning and Info Boxes */
.warning-box {
    background: rgba(120, 53, 15, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    color: #fef3c7;
}

.warning-box.small {
    padding: 1rem;
    margin: 1rem 0;
}

.warning-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.warning-header i {
    color: #fbbf24;
    font-size: 1.5rem;
}

.warning-header h3 {
    margin: 0;
    color: #fef3c7;
}

.danger-box {
    background: rgba(127, 29, 29, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fecaca;
}

.danger-box i {
    color: #fca5a5;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-box {
    background: rgba(30, 64, 175, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #dbeafe;
}

.info-box i {
    color: #93c5fd;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.success-box {
    background: rgba(4, 120, 87, 0.9);
    border: 1px solid rgba(16, 185, 129, 0.5);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #d1fae5;
}

.success-box i {
    color: #6ee7b7;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Guide Sections */
.guide-section {
    margin: 3rem 0;
}

.guide-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.guide-section h2 i {
    color: var(--primary-color);
}

/* Prerequisites Grid */
.prerequisites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.prerequisite-item {
    text-align: center;
    padding: 2rem 1rem;
    background: #374151;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.prerequisite-item:hover {
    transform: translateY(-5px);
}

.prerequisite-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.prerequisite-item h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.prerequisite-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Step Cards */
.step-card {
    background: #1f2937;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.step-card.warning-step {
    background: rgba(120, 53, 15, 0.9);
    border-color: rgba(245, 158, 11, 0.5);
}

.step-card.success-step {
    background: rgba(4, 120, 87, 0.9);
    border-color: rgba(16, 185, 129, 0.5);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.warning-step .step-number {
    background: #f59e0b;
}

.success-step .step-number {
    background: #10b981;
}

.step-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.step-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.step-content ol,
.step-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.step-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Code Blocks */
.code-block {
    background: #0f172a;
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1e293b;
    color: #cbd5e1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #cbd5e1;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Method Tabs */
.method-tabs {
    margin: 1.5rem 0;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.method-steps {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Troubleshooting */
.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.issue-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.issue-card h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.issue-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Resources */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.resource-card {
    display: block;
    text-align: center;
    padding: 2rem 1rem;
    background: var(--bg-card);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.resource-card:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

.resource-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.resource-card h4 {
    margin-bottom: 0.5rem;
}

.resource-card p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Keyboard Keys */
kbd {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    box-shadow: 0 2px 0 var(--border-color);
    color: var(--text-primary);
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

/* Module Card */
.module-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.module-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.module-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.module-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.module-title-section {
    flex: 1;
}

.module-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.module-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.module-author i {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.module-usage {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
}

.module-usage p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.module-actions {
    margin-top: auto;
}

.module-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.module-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    justify-content: center;
    text-align: center;
    font-size: 0.9rem;
}

.download-btn {
    background: var(--primary-color);
    color: white;
}

.download-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.source-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.source-btn:hover {
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

@media (max-width: 1145px) {
    .navbar {
        padding: 0.5rem 1rem;
    }

    .hamburger-menu {
        display: flex;
    }

    nav {
        display: none;
    }

    .logo h1 {
        text-wrap: nowrap;
        font-size: x-large;
    }
}


/* Responsive Design */
@media (max-width: 768px) {


    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .roms-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0;
    }

    .rom-card {
        grid-template-columns: 80px 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .screenshot-square {
        width: 80px;
        height: 80px;
    }

    .rom-content-section {
        min-height: 80px;
    }

    .action-buttons-compact {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 0.3rem;
    }

    .square-btn-compact {
        padding: 0.2rem 0.1rem;
        font-size: 0.6rem;
        min-height: 35px;
    }

    .square-btn-compact i {
        font-size: 0.7rem;
    }

    .rom-meta-compact {
        gap: 0.5rem;
    }

    .meta-item-compact {
        font-size: 0.7rem;
    }

    .tab-headers {
        gap: 0.3rem;
    }

    .tab-header {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }

    .tab-content-rom {
        font-size: 0.7rem;
        padding: 0.5rem;
        max-height: 100px;
    }

    .guide-content {
        padding: 1.5rem;
    }

    .prerequisites-grid {
        grid-template-columns: 1fr;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .filter-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .device-info,
    .installation-guide,
    .faq {
        padding: 2rem 1rem;
    }

    .specs-grid,
    .guide-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width:400px) {
    .logo h1 {
        font-size: large;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;

}

/* Video Section Styles */
.video-section {
    margin: 3rem 0;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-primary);
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-caption {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.video-caption i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* Mobile optimizations for very small screens */
@media (max-width: 480px) {
    .video-container {
        border-radius: 8px;
        margin: 0 -10px;
        width: calc(100% + 20px);
    }

    .video-caption {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 340px) {
    .video-container {
        margin: 0 -5px;
        width: calc(100% + 10px);
        border-radius: 6px;
    }

    .video-caption {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

}

/* Debloat Page Styles */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.debloat-section {
    background: var(--bg-card);
    border-radius: 12px;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.debloat-section.warning {
    border-color: var(--warning-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    background: var(--bg-secondary);
    transition: background 0.3s ease;
}

.section-header:hover {
    background: rgba(59, 130, 246, 0.1);
}

.section-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.section-content {
    display: none;
    padding: 0;
}

.section-content.active {
    display: block;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.app-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.app-card.critical {
    border-color: var(--error-color);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}

.app-info {
    flex: 1;
}

.app-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.app-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.package-name {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    word-break: break-all;
}

.app-actions {
    display: flex;
    gap: 0.5rem;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.copy-btn.disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

.copy-btn.disabled:hover {
    background: var(--border-color);
    transform: none;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1.5rem 1.5rem 0;
    flex-wrap: wrap;
}

.category-tab {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-content {
    display: none;
}

.category-content.active {
    display: block;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transition: transform 0.3s ease;
    font-weight: 600;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive Design for Debloat Page */
@media (max-width: 768px) {
    .apps-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 0.75rem;
    }

    .app-card {
        padding: 1rem;
    }

    .section-header {
        padding: 1.25rem;
    }

    .section-header h3 {
        font-size: 1.1rem;
    }

    .quick-actions {
        gap: 0.75rem;
    }

    .action-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .category-tabs {
        padding: 1rem 1rem 0;
    }

    .category-tab {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .apps-grid {
        grid-template-columns: 1fr;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .app-card {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .app-actions {
        align-self: flex-end;
    }

    .section-header {
        padding: 1rem;
    }

    .section-header h3 {
        font-size: 1rem;
    }

    .quick-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .category-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .category-tab {
        text-align: center;
    }
}

@media (max-width: 320px) {
    .apps-grid {
        padding: 0.5rem;
    }

    .app-card {
        padding: 0.6rem;
    }

    .app-name {
        font-size: 1rem;
    }

    .app-description {
        font-size: 0.8rem;
    }

    .package-name {
        font-size: 0.7rem;
    }

    .section-header {
        padding: 0.75rem;
    }

    .section-header h3 {
        font-size: 0.9rem;
    }

}

/* ===================================
   MERGED FROM enhancements.css
   =================================== */

/* Tutorial Navigation Buttons */
.tutorial-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.tutorial-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.tutorial-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.tutorial-nav-btn.bootloader {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.tutorial-nav-btn.bootloader:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.tutorial-nav-btn.stock {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tutorial-nav-btn.stock:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.tutorial-nav-btn.debloat {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.tutorial-nav-btn.debloat:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.tutorial-nav-btn i {
    font-size: 1rem;
}

/* Search Bar Styles */
.search-bar-container {
    margin-bottom: 1.5rem;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

#search-input,
#stock-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    padding: 0.25rem 0;
}

#search-input::placeholder,
#stock-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.clear-search {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    background: var(--bg-secondary);
    color: var(--error-color);
}

.results-count {
    text-align: center;
    padding: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Loading States */
.loading-state,
.error-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p,
.error-state p {
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.error-state i {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.error-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Enhanced Page Header */
.page-header h2 {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Improved Glassmorphism Effects */
.navbar {
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 100%;
    box-sizing: border-box;
}

.filter-bar {
    background: rgba(31, 41, 55, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rom-card {
    background: rgba(55, 65, 81, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rom-card:hover {
    background: rgba(55, 65, 81, 0.95);
    border-color: rgba(37, 99, 235, 0.3);
}

/* Enhanced Button Hover Effects */
.square-btn-compact {
    position: relative;
    overflow: hidden;
}

.square-btn-compact::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.square-btn-compact:hover::before {
    width: 200px;
    height: 200px;
}

.square-btn-compact:active {
    transform: translateY(0) scale(0.95);
}

/* Smooth Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Skeleton Loading Animation */
@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--bg-card) 25%,
            var(--bg-secondary) 50%,
            var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

/* Improved No Results State */
.no-results {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    animation: fadeIn 0.5s ease;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.4;
    color: var(--primary-color);
}

.no-results h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

/* Lazy Loading Images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img.loaded,
img:not([data-src]) {
    opacity: 1;
}

/* Step Checkbox for Guide */
.step-checkbox {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    margin-left: auto;
}

.step-checkbox:hover {
    border-color: var(--success-color);
    transform: scale(1.1);
}

.step-checkbox i {
    font-size: 0.9rem;
    color: transparent;
    transition: color 0.3s ease;
}

.step-checkbox.completed {
    background: var(--success-color);
    border-color: var(--success-color);
}

.step-checkbox.completed i {
    color: white;
}

/* Tutorial Cards */
.tutorial-card {
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.tutorial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(37, 99, 235, 0.3);
}

.tutorial-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.tutorial-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.tutorial-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.tutorial-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.tutorial-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.tutorial-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tutorial-link-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* YouTube Channel Button */
.youtube-channel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #ff0000;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.youtube-channel-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

/* Improved Navbar Spacing */
.navbar nav {
    display: flex;
    gap: 0.2rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    justify-content: flex-end;
}

.navbar nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    white-space: nowrap;
    padding: 0.5rem 0.6rem !important;
    font-size: 0.8rem;
}

.nav-link i {
    margin-right: 0.3rem;
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 12px;
    color: var(--text-secondary);
}

.video-placeholder i {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.video-placeholder p {
    font-size: 1.1rem;
}

/* Improve ROM Card Tabs */
.tab-headers {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-header {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Review Cards */
.review-card {
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(37, 99, 235, 0.3);
}

.review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.rom-info h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.review-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.review-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rom-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.rom-link-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Better Focus Indicators for Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    .navbar,
    .filter-bar,
    .search-bar-container,
    .mobile-nav,
    .square-btn-compact,
    footer {
        display: none !important;
    }

    .rom-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #000;
    }

    body {
        background: white;
        color: black;
    }
}

/* ===================================
   STOCK ROMS GRID STYLES
   =================================== */

/* Stock ROMs Grid */
.stock-roms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

/* Stock ROM Card */
.stock-rom-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.stock-rom-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stock-rom-image {
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a, #3730a3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stock-rom-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Version Overlay */
.version-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* Region Overlay */
.region-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stock-rom-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stock-rom-header {
    margin-bottom: 1rem;
}

.stock-rom-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stock-rom-version {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.stock-rom-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stock-rom-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.stock-rom-meta-item i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.stock-rom-actions {
    margin-top: auto;
}

.stock-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.stock-download-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===================================
   MOBILE TOUCH TARGETS & VIEWPORT
   =================================== */

/* Touch-friendly Mobile Enhancements - Ensure 44px minimum touch targets */
@media (hover: none) and (pointer: coarse) {
    .square-btn-compact {
        min-height: 48px;
        padding: 0.5rem 0.4rem;
    }

    .nav-link {
        min-height: 44px;
        padding: 0.75rem 0.75rem;
    }

    .faq-question {
        min-height: 48px;
        padding: 1.25rem;
    }

    .mobile-nav-link {
        min-height: 48px;
        padding: 1rem 2rem;
    }

    .tutorial-nav-btn,
    .tutorial-link-btn,
    .youtube-channel-btn,
    .rom-link-btn,
    .stock-download-btn,
    .action-btn,
    .tab-button,
    .category-tab {
        min-height: 48px;
    }

    .copy-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .hamburger-menu {
        /* Removed min-width/height that was causing it to look too large */
        display: flex;
        /* Ensure it matches the standard size defined earlier */
        width: 30px;
        height: 21px; 
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .rom-card {
        border: 2px solid var(--text-primary);
    }

    .search-bar {
        border: 2px solid var(--text-primary);
    }
}

/* Responsive adjustments for tutorial buttons and cards */
@media (max-width: 768px) {
    .tutorial-buttons {
        flex-direction: column;
    }

    .tutorial-nav-btn {
        width: 100%;
        justify-content: center;
    }

    .tutorial-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .tutorial-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .tutorial-header h3 {
        font-size: 1.25rem;
    }

    .tutorial-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tutorial-link-btn {
        width: 100%;
        justify-content: center;
    }

    .video-placeholder {
        min-height: 200px;
    }

    .review-header {
        flex-direction: column;
    }

    .rom-link-btn {
        width: 100%;
        justify-content: center;
    }

    .review-meta {
        gap: 1rem;
    }

    .rom-info h3 {
        font-size: 1.25rem;
    }

    .stock-roms-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
        padding: 1rem 0;
    }

    .stock-rom-content {
        padding: 1.25rem;
    }

    .stock-rom-meta {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

@media (max-width: 1400px) {
    .nav-link {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.75rem;
    }

    .nav-link i {
        margin-right: 0.2rem;
    }
}

@media (max-width: 1320px) {
    .navbar nav {
        display: none;
    }

    .hamburger-menu {
        display: flex !important;
        z-index: 1002;
        position: relative;
    }
}

/* Performance Optimization for Scroll Stuttering on Mobile */
@media (max-width: 768px) {
    header, 
    .navbar, 
    .mobile-nav, 
    .filter-bar, 
    .modal,
    .modal-content {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(17, 24, 39, 0.98); /* Solid background fallback */
    }

    /* Use simple background for mobile nav to avoid transparency calc overhead */
    .mobile-nav {
         background: #111827;
    }
    
    header {
         background: #111827;
         border-bottom: 1px solid #374151;
    }
}

@media (max-width: 480px) {
    .stock-roms-grid {
        grid-template-columns: 1fr;
    }

    .stock-rom-image {
        height: 150px;
    }

    .stock-rom-content {
        padding: 1rem;
    }

    .stock-rom-title {
        font-size: 1.2rem;
    }

    .stock-rom-meta-item {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .stock-rom-card {
        margin: 0 -5px;
        width: calc(100% + 10px);
    }

    .stock-rom-content {
        padding: 0.75rem;
    }
}

@media (max-width: 320px) {
    .stock-rom-image {
        height: 120px;
    }

    .stock-rom-title {
        font-size: 1.1rem;
    }

    .stock-rom-version {
        font-size: 0.8rem;
    }

    .stock-rom-meta-item {
        font-size: 0.75rem;
    }

    .stock-download-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==========================================
   DEVELOPER PORTAL STYLES
   ========================================== */

/* Login Screen */
.dev-login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-primary);
    background-image: linear-gradient(135deg, rgba(30, 58, 138, 0.2) 0%, rgba(88, 28, 135, 0.2) 100%);
}

.dev-login-container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.dev-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dev-login-header i {
    font-size: 3rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.dev-login-header h1 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dev-login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.dev-login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dev-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dev-input-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.dev-input-group input,
.dev-input-group select {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.dev-input-group input:focus,
.dev-input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.dev-input-group input.error {
    border-color: var(--error-color);
}

.dev-password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.dev-password-input input {
    width: 100%;
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.dev-error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
    font-size: 0.9rem;
}

.dev-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dev-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

/* Developer Dashboard */
.dev-dashboard {
    min-height: 100vh;
    background: var(--bg-primary);
    background-image: linear-gradient(135deg, rgba(30, 58, 138, 0.1) 0%, rgba(88, 28, 135, 0.1) 100%);
}

.dev-header {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dev-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dev-header h1 {
    font-size: 1.25rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dev-header h1 i {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dev-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.dev-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.dev-logout-btn:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    color: white;
}

.dev-main {
    padding: 2rem;
}

.dev-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Developer Sections */
.dev-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.dev-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.dev-section h2 i {
    color: var(--primary-color);
}

.dev-section-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ROM Type Toggle */
.rom-type-section {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
}

.rom-type-toggle {
    display: flex;
    gap: 1rem;
}

.rom-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rom-type-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.rom-type-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    border-color: transparent;
}

.rom-type-btn i {
    font-size: 1.25rem;
}

/* Form Grid */
.dev-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.dev-form-grid .full-width {
    grid-column: 1 / -1;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.checkbox-label input[type="checkbox"]:checked+.checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked+.checkmark::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* File Upload Areas */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.upload-placeholder:hover {
    color: var(--primary-color);
}

.upload-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.upload-preview {
    position: relative;
    padding: 1rem;
}

.upload-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.remove-upload {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--error-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-upload:hover {
    transform: scale(1.1);
}

/* Screenshots Grid */
.screenshots-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.screenshots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.screenshot-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.screenshot-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.screenshot-preview-item .remove-screenshot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--error-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screenshot-preview-item:hover .remove-screenshot {
    opacity: 1;
}

.screenshot-number {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.add-screenshots-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.add-screenshots-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Dynamic Fields */
.dynamic-fields-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dynamic-field-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dynamic-field-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.dynamic-field-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.remove-field-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.remove-field-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.add-field-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    color: var(--primary-color);
    border: 1px dashed var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    width: fit-content;
}

.add-field-btn:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* Submit Section */
.submit-section {
    background: transparent;
    border: none;
    padding: 0;
}

.dev-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dev-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}

/* JSON Output Section */
.json-output-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
}

.json-instructions {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.json-instructions p {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.json-instructions ol {
    color: var(--text-secondary);
    padding-left: 1.5rem;
    margin: 0;
}

.json-instructions li {
    margin-bottom: 0.5rem;
}

.json-instructions code {
    background: var(--bg-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: var(--primary-color);
}

.json-output-container {
    position: relative;
    background: var(--bg-primary);
    border-radius: 10px;
    overflow: hidden;
}

#json-output {
    padding: 1.25rem;
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: pre;
    max-height: 400px;
    overflow-y: auto;
}

.copy-json-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-json-btn:hover {
    background: var(--secondary-color);
}

.copy-json-btn.copied {
    background: var(--success-color);
}

/* Image Download List */
.image-files-section {
    margin-top: 1.5rem;
}

.image-files-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.image-download-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.image-download-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.image-download-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.image-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.image-info .target-path {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.image-info .original-name {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.download-image-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.download-image-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

/* Responsive Design for Developer Portal */
@media (max-width: 768px) {
    .dev-login-container {
        padding: 2rem;
    }

    .dev-header {
        padding: 1rem;
    }

    .dev-header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .dev-main {
        padding: 1rem;
    }

    .rom-type-toggle {
        flex-direction: column;
    }

    .dev-form-grid {
        grid-template-columns: 1fr;
    }

    .dev-section {
        padding: 1rem;
    }

    .json-instructions {
        padding: 1rem;
    }

    .json-instructions ol {
        padding-left: 1rem;
    }
}

@media (max-width: 480px) {
    .dev-login-header i {
        font-size: 2.5rem;
    }

    .dev-login-header h1 {
        font-size: 1.5rem;
    }

    .dev-section h2 {
        font-size: 1.1rem;
    }

    .screenshot-preview-item {
        width: 60px;
        height: 60px;
    }
}

/* ==========================================
   MY ROMS SECTION & UPLOAD STATUS
   ========================================== */

/* Upload Status */
.upload-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.upload-status.loading {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.upload-status.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.upload-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

/* My ROMs Section */
.my-roms-section {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
}

.my-roms-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.my-rom-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.my-rom-item:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.my-rom-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.my-rom-info {
    flex: 1;
    min-width: 0;
}

.my-rom-info h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-rom-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.my-rom-meta i {
    color: var(--success-color);
}

.rom-date {
    color: var(--text-secondary);
    opacity: 0.7;
}

.delete-rom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.delete-rom-btn:hover {
    background: var(--error-color);
    color: white;
    transform: scale(1.05);
}

.no-roms-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.no-roms-message i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.no-roms-message p {
    font-size: 0.95rem;
}

/* Responsive My ROMs */
@media (max-width: 480px) {
    .my-rom-item {
        padding: 0.75rem;
    }

    .my-rom-item img {
        width: 50px;
        height: 50px;
    }

    .my-rom-info h4 {
        font-size: 0.9rem;
    }

    .my-rom-meta {
        font-size: 0.75rem;
        flex-wrap: wrap;
    }
}
