@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

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

body {
    font-family: 'Courier Prime', monospace;
    background-color: #f5f1e8;
    color: #1a1a1a;
}

/* ====== Layout ====== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ====== Sidebar ====== */
.sidebar {
    width: 200px;
    background: #fff;
    border-right: 2px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 2px solid #1a1a1a;
}

.logo {
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    color: #1a1a1a;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 13px;
}

.nav-item:hover {
    background-color: #f5f1e8;
}

.nav-item.active {
    border-left: 4px solid #cc0000;
    background-color: #f5f1e8;
}

.sidebar-rules {
    margin: 20px 10px;
    padding: 15px;
    border: 2px solid #1a1a1a;
    background: #fff;
}

.rules-header {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}

.rules-list {
    font-size: 11px;
    padding-left: 15px;
    line-height: 1.6;
}

/* ====== Main Content ====== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 2px solid #1a1a1a;
}

.search-container {
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #1a1a1a;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    background: #fff;
}

.search-input:focus {
    outline: none;
    border-color: #cc0000;
}

.page-content {
    padding: 25px;
    flex: 1;
}

/* ====== Pokemon-Style Cards ====== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.pokemon-card {
    background: linear-gradient(145deg, #fff9e6 0%, #f5f1e8 100%);
    border: 4px solid #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        6px 6px 0 #1a1a1a,
        inset 0 0 0 2px #d4af37;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pokemon-card:hover {
    transform: translate(-3px, -3px);
    box-shadow:
        9px 9px 0 #1a1a1a,
        inset 0 0 0 2px #d4af37;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(90deg, #d4af37, #f0d060);
    border-bottom: 2px solid #1a1a1a;
}

.card-id {
    font-size: 10px;
    color: #1a1a1a;
    font-weight: bold;
}

.card-flag {
    font-size: 14px;
}

.card-image-frame {
    margin: 12px;
    border: 3px solid #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    background: #ddd;
    aspect-ratio: 4/3;
}

.card-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image-frame .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    color: #999;
    font-size: 12px;
}

.card-body {
    padding: 0 12px 12px;
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #1a1a1a;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 6px;
}

.card-desc {
    font-size: 12px;
    color: #444;
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-reason {
    font-size: 11px;
    background: #fff;
    border: 1px solid #1a1a1a;
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.card-reason strong {
    color: #cc0000;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    font-size: 10px;
    padding: 3px 8px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 10px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: linear-gradient(90deg, #d4af37, #f0d060);
    border-top: 2px solid #1a1a1a;
}

.card-stats {
    display: flex;
    gap: 15px;
    font-size: 11px;
    font-weight: bold;
}

.card-likes {
    color: #cc0000;
}

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

.btn-like,
.btn-download,
.btn-share {
    padding: 6px 10px;
    border: 2px solid #1a1a1a;
    background: #fff;
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
}

.btn-like:hover {
    background: #cc0000;
    color: #fff;
    border-color: #cc0000;
}

.btn-download:hover,
.btn-share:hover {
    background: #1a1a1a;
    color: #fff;
}

/* ====== Create Page ====== */
.create-container {
    display: flex;
    gap: 30px;
    max-width: 900px;
}

.create-preview {
    flex: 1;
}

.preview-box {
    border: 3px solid #1a1a1a;
    aspect-ratio: 1/1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 8px;
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-placeholder {
    color: #999;
    font-size: 13px;
}

.preview-hint {
    font-size: 10px;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

.create-form {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.file-input {
    display: none;
}

.file-upload-btn {
    padding: 12px 18px;
    background: #1a1a1a;
    color: #fff;
    border: 2px solid #1a1a1a;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.file-upload-btn:hover {
    background: #cc0000;
    border-color: #cc0000;
}

.file-name {
    font-size: 11px;
    color: #666;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #1a1a1a;
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    border-radius: 4px;
}

.form-input:focus {
    outline: none;
    border-color: #cc0000;
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #1a1a1a;
    font-family: 'Courier Prime', monospace;
    font-size: 13px;
    resize: vertical;
    border-radius: 4px;
}

.form-textarea:focus {
    outline: none;
    border-color: #cc0000;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.form-select {
    flex: 1;
    padding: 12px;
    border: 2px solid #1a1a1a;
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    background: #fff;
    border-radius: 4px;
}

.nationality-select {
    flex: 1.5;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: #1a1a1a;
    color: #fff;
    border: 2px solid #1a1a1a;
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #cc0000;
    border-color: #cc0000;
}

/* ====== Status Bar ====== */
.status-bar {
    font-size: 10px;
    padding: 8px 20px;
    border-top: 2px solid #1a1a1a;
    background: #fff;
    text-align: center;
    color: #666;
}

/* ====== Empty State ====== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #666;
    font-size: 14px;
}

.empty-state a {
    color: #cc0000;
}

/* ====== Responsive ====== */
@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .create-container {
        flex-direction: column;
    }

    .form-row {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 2px solid #1a1a1a;
        overflow-x: auto;
    }

    .sidebar-header {
        border-bottom: none;
        border-right: 2px solid #1a1a1a;
        padding: 10px 15px;
    }

    .sidebar-nav {
        flex-direction: row;
    }

    .nav-item {
        border-bottom: none;
        border-right: 1px solid #ddd;
        white-space: nowrap;
        padding: 10px 12px;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid #cc0000;
    }

    .sidebar-rules {
        display: none;
    }

    .top-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }

    .search-container {
        width: 100%;
    }

    .page-content {
        padding: 15px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .pokemon-card {
        box-shadow: 4px 4px 0 #1a1a1a, inset 0 0 0 2px #d4af37;
    }

    .card-body {
        padding: 0 10px 10px;
    }

    .card-title {
        font-size: 14px;
    }

    .card-actions {
        gap: 6px;
    }

    .btn-like,
    .btn-download,
    .btn-share {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Create page mobile */
    .create-container {
        gap: 15px;
    }

    .preview-box {
        aspect-ratio: 16/9;
        max-height: 200px;
    }

    .form-input,
    .form-textarea,
    .form-select {
        padding: 14px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .btn-submit {
        padding: 16px;
        font-size: 16px;
    }

    .file-upload-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .card-footer {
        flex-direction: column;
        gap: 10px;
    }

    .card-actions {
        width: 100%;
        justify-content: space-between;
    }

    .pokemon-card:hover {
        transform: none;
    }
}

/* Full width select for nationality */
.full-width {
    width: 100%;
}

/* ====== Made By Credit ====== */
.made-by {
    position: fixed;
    bottom: 8px;
    left: 8px;
    font-size: 9px;
    color: #999;
    z-index: 100;
}

.made-by a {
    color: #999;
    text-decoration: none;
}

.made-by a:hover {
    color: #cc0000;
    text-decoration: underline;
}