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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    padding: 24px 16px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: #fff;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 50;
}

.app {
    padding-left: 220px;
}

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

.sidebar-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 12px 16px;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    font-weight: 400;
    font-size: 16px;
    text-decoration: none;
    color: #000;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #000;
    font-size: 18px;
}

ion-icon.sidebar-icon {
    visibility: hidden;
}

ion-icon.sidebar-icon.hydrated {
    visibility: visible;
}

.sidebar-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-link .sidebar-icon-filled {
    display: none;
}

.sidebar-link .sidebar-icon-outline {
    display: block;
}

.sidebar-link.active .sidebar-icon-outline {
    display: none;
}

.sidebar-link.active .sidebar-icon-filled {
    display: block;
}

.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 5px;
}

.lang-btn {
    padding: 10px 20px;
    border: 2px solid #5bcefa;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
}

.lang-btn:hover {
    background: #f5a9b8;
    color: white;
}

.container {
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.feed {
    margin-top: 24px;
    position: relative;
}

.feed-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .feed-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .feed-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feed-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.feed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-image {
    width: 100%;
    height: auto;
    background: linear-gradient(135deg, #5bcefa, #f5a9b8);
}

.card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
}

.card-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.response-detail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 220px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: stretch;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.response-detail.hidden {
    display: none;
}

.detail-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.detail-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #666;
    padding: 12px 16px;
    transition: all 0.2s;
    font-weight: 500;
}

.detail-back:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.detail-back span:first-child {
    font-size: 18px;
}

.detail-back-desktop {
    position: absolute;
    top: 8px;
    right: 8px;
    border-radius: 8px;
}

.detail-back-mobile {
    display: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    justify-content: center;
    padding: 16px;
}

.detail-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 16px;
}

.detail-text {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

.detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.detail-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.detail-timestamp {
    font-size: 10px;
    color: #bbb;
    margin-top: 20px;
    text-align: left;
}

.response-loading,
.response-empty {
    color: #666;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 30px;
    gap: 10px;
}

.trans-flag {
    width: 70px;
    height: 44px;
    display: flex;
    flex-direction: column;
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.stripe {
    flex: 1;
}

.stripe.blue {
    background: #5bcefa;
}

.stripe.pink {
    background: #f5a9b8;
}

.stripe.white {
    background: #ffffff;
}

.header-interpunct {
    font-size: 1.5rem;
    color: #999;
    margin: 0 10px;
}

.header-title {
    font-family: 'Reenie Beanie', cursive;
    font-size: 2.5rem;
    font-weight: 400;
    color: #333;
    margin: 0;
    text-align: center;
}

.header-interpunct-nav {
    display: none;
}

.header-nav-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    color: #000;
    text-decoration: none;
    border: 2px solid #000;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.header-nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: #333;
}

.header-nav-btn:active {
    background: rgba(0, 0, 0, 0.1);
}

.header-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #000;
    font-size: 18px;
}

ion-icon.header-nav-icon {
    visibility: hidden;
}

ion-icon.header-nav-icon.hydrated {
    visibility: visible;
}

.header-nav-icon-filled {
    display: none;
}

.header-nav-icon-outline {
    display: block;
}

.header-nav-btn:hover .header-nav-icon-outline {
    display: none;
}

.header-nav-btn:hover .header-nav-icon-filled {
    display: block;
}

.pride-flag {
    width: 70px;
    height: 44px;
    display: flex;
    flex-direction: column;
    border-radius: 2px;
    overflow: hidden;
    margin-left: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.pride-flag .stripe {
    flex: 1;
}

.pride-flag .stripe.red {
    background: #e40303;
}

.pride-flag .stripe.orange {
    background: #ff8c00;
}

.pride-flag .stripe.yellow {
    background: #ffed00;
}

.pride-flag .stripe.green {
    background: #008026;
}

.pride-flag .stripe.blue {
    background: #004dff;
}

.pride-flag .stripe.purple {
    background: #750787;
}

.content {
    background: transparent;
    padding: 0;
    flex: 1;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    text-align: left;
    font-size: 2rem;
    font-family: 'The Girl Next Door', cursive;
}

h2 {
    color: #000;
    margin: 30px 0 15px;
    font-size: 1.3rem;
    font-family: 'The Girl Next Door', cursive;
}

p {
    margin-bottom: 15px;
    text-align: justify;
    color: #333;
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 10px;
}

a {
    color: #0066cc;
    text-decoration: underline;
}

a:hover {
    color: #004499;
}

.hidden {
    display: none !important;
}

.submission-form {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f5a9b8;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #5bcefa;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #f5a9b8;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s;
    background: rgba(255, 255, 255, 0.9);
}

textarea:focus {
    outline: none;
    border-color: #5bcefa;
}

input[type="file"] {
    width: 100%;
    padding: 15px;
    border: 2px dashed #f5a9b8;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #5bcefa;
}

button[type="submit"] {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #5bcefa, #f5a9b8);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
}

button[type="submit"]:active {
    transform: translateY(0);
}

.form-message {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-message.loading {
    background: rgba(91, 206, 250, 0.15);
    color: #333;
    border: 1px solid #5bcefa;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.form-message.loading p {
    margin: 0;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(91, 206, 250, 0.3);
    border-top-color: #5bcefa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-message.success a,
.form-message.error a {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.form-message.success a:hover,
.form-message.error a:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.form-message small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.retry-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    color: inherit;
    transition: all 0.2s;
}

.retry-btn:hover {
    background: rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.site-footer {
    display: block;
    text-align: center;
    margin-top: 10px;
    padding: 40px 0 20px;
    font-size: 0.95rem;
    color: #555;
    font-size: 12px;
}

.site-footer a {
    color: #333;
    font-weight: bold;
}

.site-footer a:hover {
    color: #5bcefa;
}

.site-footer p {
    text-align: center;
}

@media (min-width: 601px) {
    .sidebar {
        display: none;
    }

    .app {
        padding-left: 0;
    }

    .response-detail {
        left: 0;
    }

    .header-interpunct-nav {
        display: block;
    }

    .header-nav-btn {
        display: inline-flex;
    }
}

@media (max-width: 600px) {
    .header {
        display: grid;
        grid-template-columns: auto auto;
        gap: 5px;
        justify-items: center;
        align-items: center;
        justify-content: space-around;
    }

    .header-interpunct {
        display: none;
    }

    .header-interpunct-nav {
        display: none !important;
    }

    .header-nav-btn {
        display: none !important;
    }

    .header-title {
        font-size: 1.8rem;
        margin-top: 10px;
        grid-column: 1 / -1;
    }

    .trans-flag,
    .pride-flag {
        width: 60px;
        height: 36px;
    }

    .pride-flag {
        margin-left: -50px;
    }

    .container {
        padding: 20px 15px;
    }

    .app {
        flex-direction: column;
        padding-left: 0;
        padding-bottom: 70px;
    }

    .sidebar {
        width: 100%;
        height: auto !important;
        position: fixed;
        bottom: 0;
        left: 0;
        flex-direction: row;
        gap: 0;
        border-right: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        border-bottom: 0;
        padding: 12px 8px;
        overflow-x: auto;
        overflow-y: hidden !important;
        align-items: center;
        z-index: 50;
        top: auto;
    }

    .sidebar-nav {
        flex-direction: row;
        flex: 1; /* allow it to stretch full width */
        gap: 0;
        justify-content: space-evenly;
        align-items: center;
    }

    .sidebar-link {
        padding: 12px 8px;
        font-size: 13px;
        gap: 6px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-right: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .sidebar-icon {
        width: 16px;
        height: 16px;
    }
    
    .content {
        padding: 25px 20px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .language-toggle {
        top: 10px;
        right: 10px;
    }
    
    .lang-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .feed-list {
        grid-template-columns: 1fr;
    }

    .response-detail {
        left: 0;
        padding: 16px;
        padding-bottom: 86px;
    }

    .detail-back-desktop {
        display: none;
    }

    .detail-back-mobile {
        display: flex;
    }
}
