/* Import pixel font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* CSS Variables for theme */
:root {
    --bg-dark: #0f0f1e;
    --bg-medium: #1a1a2e;
    --bg-light: #1a1a2e;
    --accent-purple: #ff006e;
    --accent-green: #00ff9f;
    --text-primary: #ffffff;
    --text-secondary: rgba(0, 255, 159, 0.6);
    --border-color: #00ff9f;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Light Mode */
body.light-mode {
    --bg-dark: #f5f5f5;
    --bg-medium: #ffffff;
    --bg-light: #ffffff;
    --accent-purple: #ff006e;
    --accent-green: #00cc7f;
    --text-primary: #1a1a1a;
    --text-secondary: rgba(0, 0, 0, 0.6);
    --border-color: #00cc7f;
    --shadow: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-medium) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    image-rendering: pixelated;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    margin-bottom: 40px;
    padding: 30px 20px;
    background: var(--bg-light);
    border: 4px solid var(--border-color);
    box-shadow: 8px 8px 0px var(--shadow);
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    width: 100%;
}

.header-content>div {
    flex: 1;
}

.theme-toggle {
    background: transparent;
    border: 3px solid var(--border-color);
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--border-color);
    transform: scale(1.1);
}

.theme-toggle svg {
    stroke: var(--text-primary);
}

.header::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--accent-purple);
    pointer-events: none;
}

.title {
    font-size: 36px;
    color: var(--accent-green);
    text-shadow: 3px 3px 0px var(--accent-purple), 4px 4px 0px var(--shadow);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

@media (min-width: 768px) {
    .title {
        font-size: 48px;
    }
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Post Form */
.post-form-container {
    background: var(--bg-medium);
    border: 4px solid var(--border-color);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 8px 8px 0px var(--shadow);
}

.post-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 3px solid var(--border-color);
    resize: vertical;
    line-height: 1.625;
}

.post-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px var(--accent-purple);
}

.post-input::placeholder {
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.char-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-post {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    padding: 12px 20px;
    background: var(--accent-purple);
    color: var(--text-primary);
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 4px 4px 0px var(--shadow);
}

.btn-post:hover {
    background: var(--accent-green);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--shadow);
}

.btn-post:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px var(--shadow);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    padding: 10px 15px;
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: all 0.1s;
    flex: 1;
}

.filter-btn:hover {
    background: var(--bg-medium);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-purple);
    color: var(--text-primary);
    border-color: var(--accent-green);
}

/* Posts Container */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Individual Post */
.post {
    background: var(--bg-medium);
    border: 4px solid var(--border-color);
    padding: 20px;
    box-shadow: 8px 8px 0px var(--shadow);
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.post-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.post-id {
    font-size: 12px;
    color: var(--accent-green);
    font-weight: bold;
}

.post-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.post-content {
    font-size: 14px;
    line-height: 1.625;
    color: var(--text-primary);
    margin-bottom: 15px;
    word-wrap: break-word;
}

.post-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.like-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 8px 15px;
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 3px solid var(--border-color);
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.like-btn:hover {
    background: var(--bg-dark);
    transform: scale(1.05);
}

.like-btn.liked {
    background: var(--accent-purple);
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.like-btn:active {
    transform: scale(0.95);
}

.like-count {
    font-size: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-medium);
    border: 4px dashed var(--border-color);
    margin-top: 20px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 10px 0;
}

.empty-state.hidden {
    display: none;
}

/* Delete Button */
.delete-btn {
    font-family: 'Press Start 2P', monospace;
    padding: 8px 12px;
    background: #ff0000;
    color: var(--text-primary);
    border: 2px solid #ff0000;
    cursor: pointer;
    transition: all 0.1s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn svg {
    stroke: currentColor;
}

.delete-btn:hover {
    background: #cc0000;
    border-color: #cc0000;
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 600px) {
    .title {
        font-size: 36px;
    }

    .subtitle {
        font-size: 12px;
    }

    .post-input {
        font-size: 12px;
    }

    .btn-post {
        font-size: 12px;
        padding: 10px 15px;
    }

    .post-content {
        font-size: 12px;
    }
}

/* Pixelated cursor */
body {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><rect x="0" y="0" width="8" height="8" fill="%2300ff9f"/><rect x="0" y="8" width="8" height="8" fill="%2300ff9f"/><rect x="8" y="4" width="8" height="8" fill="%2300ff9f"/></svg>'), auto;
}

button,
.like-btn {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><rect x="4" y="0" width="8" height="4" fill="%23ff006e"/><rect x="0" y="4" width="16" height="8" fill="%23ff006e"/><rect x="4" y="12" width="8" height="4" fill="%23ff006e"/></svg>'), pointer;
}

/* Footer */
.footer {
    margin-top: 60px;
    padding: 20px;
    text-align: center;
    background: transparent;
    border-top: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body.light-mode .footer {
    background: transparent;
    border-top: none;
}

.footer-text {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
    font-weight: 400;
    opacity: 0.8;
}

.footer-link {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.footer-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.lang-toggle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    padding: 8px 16px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

body.light-mode .lang-toggle {
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-green);
}

body.light-mode .lang-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.lang-toggle:active {
    transform: scale(0.98);
}