:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --accent: #2563eb;
    /* Soft Blue */
    --border-color: #e4e6eb;
    --modal-overlay: rgba(255, 255, 255, 0.95);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-y: scroll;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 0;
    box-shadow: var(--shadow-sm);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: -0.01em;
}

/* Feed */
#feed {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Reduced gap between cards */
    padding: 0.5rem 0 4rem 0;
}

.post-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    /* Slightly smaller radius */
    padding: 0.75rem;
    /* Reduced padding */
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
    margin: 0 0.5rem;
    /* Small margin on sides for mobile */
}

@media (min-width: 600px) {
    .post-card {
        margin: 0 auto;
        width: 100%;
        max-width: 600px;
    }
}

.post-card:active {
    transform: scale(0.98);
}

.post-content {
    display: flex;
    gap: 0.75rem;
    /* Reduced gap */
    align-items: flex-start;
}

.post-image {
    width: 80px;
    /* Slightly smaller image */
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #e0e0e0;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.post-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 80px;
    /* Match image height */
}

.post-title {
    font-size: 0.95rem;
    /* Slightly smaller font */
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    /* Limit title lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
    /* Push time to bottom */
}

.post-time {
    display: inline-block;
    font-size: 0.7rem;
    color: #475569;
    font-weight: 600;
    background-color: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    align-self: flex-start;
    margin-top: 0.5rem;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: none;
}

.loading.active {
    display: block;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

@media (min-width: 640px) {
    .modal-overlay {
        align-items: center;
    }
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 640px;
    height: 90vh;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    overflow-y: auto;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: var(--shadow-lg);
}

@media (min-width: 640px) {
    .modal-content {
        height: auto;
        max-height: 85vh;
        border-radius: 24px;
        transform: translateY(20px);
    }
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.modal-text {
    padding: 1.5rem;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.modal-excerpt {
    background-color: #f8fafc;
    border-left: 4px solid #2563eb;
    padding: 2rem 1rem 1rem 1rem;
    border-radius: 8px;
    position: relative;
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.modal-excerpt::before {
    content: "HABERİN ÖZETİ";
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.read-more-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: var(--bg-color);
    color: var(--accent);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.read-more-btn:hover {
    background-color: #e5e7eb;
}

.full-content {
    display: none;
    margin-top: 1.5rem;
}

.modal-html {
    font-size: 1rem;
    color: #374151;
    line-height: 1.7;
}

.modal-html p {
    margin-bottom: 1rem;
}

.modal-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.modal-html img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1rem 0;
    box-shadow: var(--shadow-sm);
}