/* ULTRA MINIMAL TYPEWRITER STYLE */

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

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

body {
    font-family: 'IBM Plex Mono', monospace;
    background: #fff;
    color: #000;
    line-height: 1.4;
    font-size: 14px;
    font-weight: 400;
}

.container {
    padding: 20px;
    max-width: 1200px;
}

/* HEADER */
header {
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 14px;
    font-weight: normal;
    letter-spacing: 0;
    color: #000;
}

h2 {
    font-size: 14px;
    font-weight: normal;
    letter-spacing: 0;
    margin-bottom: 10px;
    color: #000;
}

.auth-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.username {
    letter-spacing: 0;
    font-weight: normal;
    color: #00f;
}

/* BUTTONS */
.btn {
    background: #000;
    color: #fff;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 0;
    text-decoration: none;
    display: inline-block;
    font-weight: normal;
}

.btn:hover {
    background: #00f;
}

.btn:active {
    transform: none;
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #fff;
    padding: 20px;
    min-width: 400px;
}

.modal-content input[type="text"],
.modal-content input[type="password"] {
    width: 100%;
    padding: 4px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: #000;
    font-weight: normal;
}

.button-group {
    display: flex;
    gap: 10px;
}

.error {
    color: #00f;
    margin-top: 10px;
    font-weight: normal;
}

/* POST FORM */
.post-form {
    padding: 20px 0;
    background: #fff;
    margin-bottom: 20px;
}

.post-form textarea {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    resize: vertical;
    color: #000;
    font-weight: normal;
}

.post-form input[type="file"] {
    margin-bottom: 10px;
    font-family: inherit;
    color: #000;
    font-size: 14px;
}

.post-form select {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    color: #000;
    font-weight: normal;
}

.image-upload-list {
    margin-bottom: 10px;
}

.image-upload-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
}

.image-upload-item select {
    flex: 1;
}

.image-upload-item button {
    background: #000;
    color: #fff;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

/* FEED */
.feed {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.post {
    background: #fff;
    padding-bottom: 0;
    position: relative;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}

.post-meta {
    flex: 1;
}

.post-date {
    font-weight: normal;
    font-size: 14px;
    letter-spacing: 0;
    display: block;
    color: #00f;
}

.post-actions {
    display: flex;
    gap: 5px;
}

.post-content {
    display: flex;
    gap: 20px;
}

.post-left {
    width: 200px;
    flex-shrink: 0;
}

.post-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #000;
    font-size: 14px;
    line-height: 1.4;
    font-weight: normal;
    margin-top: 5px;
}

.post-right {
    flex: 1;
}

/* BILD LAYOUTS */
.post-images {
    display: grid;
    gap: 10px;
}

.post-images.layout-full {
    grid-template-columns: 1fr;
}

.post-images.layout-two {
    grid-template-columns: 1fr 1fr;
}

.post-images.layout-three {
    grid-template-columns: 1fr 1fr 1fr;
}

.post-images.layout-four {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.post-images img {
    width: 100%;
    height: auto;
    display: block;
}

.post-divider {
    display: none;
}

/* BUTTON VARIANTS */
.btn-secondary {
    background: #ccc;
    color: #000;
}

.btn-secondary:hover {
    background: #000;
    color: #fff;
}

.btn-danger {
    background: #00f;
    color: #fff;
}

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

.btn-small {
    padding: 4px 8px;
    font-size: 14px;
}

/* MODAL LARGE */
.modal-large {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large textarea {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    resize: vertical;
    color: #000;
    min-height: 100px;
    font-weight: normal;
}

/* EXISTING IMAGES IN MODAL */
.existing-images {
    margin-bottom: 10px;
}

.existing-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.existing-image-item {
    position: relative;
}

.existing-image-item .layout-select {
    width: 100%;
    margin-top: 4px;
    padding: 4px;
    border: 1px solid #ccc;
    background: #fff;
    color: #000;
    font-family: inherit;
    font-size: 14px;
    font-weight: normal;
}

.existing-image-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #00f;
    color: #fff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: #000;
}

/* IMAGE UPLOAD SECTION */
.image-upload-section {
    margin-bottom: 10px;
}

.label {
    font-size: 14px;
    font-weight: normal;
    letter-spacing: 0;
    margin-bottom: 10px;
    color: #00f;
}

/* EMPTY STATE */
.empty-state {
    text-align: left;
    padding: 20px 0;
    color: #00f;
    font-weight: normal;
    letter-spacing: 0;
}

/* LOADING */
.loading {
    text-align: left;
    padding: 20px 0;
    font-weight: normal;
    letter-spacing: 0;
    color: #00f;
}

.load-trigger {
    height: 1px;
}

/* LIGHTBOX */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
    padding: 20px;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #000;
    font-size: 40px;
    cursor: pointer;
    font-weight: normal;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}

.lightbox-close:hover {
    color: #00f;
}

/* HIDE CLOAK */
[x-cloak] {
    display: none !important;
}

/* FOOTER */
footer {
    margin-top: 60px;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer > div {
    display: flex;
    gap: 20px;
}

footer a {
    color: #000;
    text-decoration: none;
    font-size: 14px;
}

footer a:hover {
    color: #00f;
}

/* STATIC PAGES */
p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .auth-section {
        width: 100%;
        justify-content: flex-start;
    }

    .post-content {
        flex-direction: column;
    }

    .post-left {
        width: 100%;
    }

    .post-right {
        width: 100%;
    }

    .post-images.layout-three {
        grid-template-columns: 1fr 1fr;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        min-width: auto;
        width: 100%;
        margin: 0;
        padding: 15px;
    }

    .modal-large {
        max-height: calc(100vh - 40px);
    }

    .image-upload-item {
        flex-direction: column;
    }

    .image-upload-item select {
        width: 100%;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .btn {
        width: 100%;
    }

    .post-header {
        flex-direction: column;
    }

    .post-actions {
        width: 100%;
    }

    .post-actions .btn {
        flex: 1;
    }

    .existing-images-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .lightbox-close {
        top: 5px;
        right: 10px;
        font-size: 30px;
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .post-images.layout-two,
    .post-images.layout-three {
        grid-template-columns: 1fr;
    }

    .existing-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.file-input {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    background: #fff;
    color: #000;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: normal;
}

.new-files-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.new-file-item {
    position: relative;
    padding: 6px;
}

.new-file-item img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    display: block;
    margin-bottom: 6px;
}

.new-file-item .file-name {
    font-size: 14px;
    color: #000;
    word-break: break-all;
}

.new-images-layout select {
    width: 100%;
    padding: 4px;
    border: 1px solid #ccc;
    background: #fff;
    color: #000;
    font-family: inherit;
    font-size: 14px;
    font-weight: normal;
}
