:root {
    --primary: #ff7b9c;
    --secondary: #ffc145;
    --accent: #6a67ce;
    --light: #f9f7fe;
    --dark: #333344;
    --header-height: 180px;
    --header-collapsed-height: 80px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: var(--header-height);
    transition: padding-top 0.3s ease;
}

body.header-collapsed {
    padding-top: var(--header-collapsed-height);
}

header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

header.collapsed {
    height: var(--header-collapsed-height);
    padding: 0.5rem 1rem;
}

.header-content {
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 200px;
}

header.collapsed .header-content {
    max-height: 0;
    opacity: 0;
}

h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

header.collapsed h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

header.collapsed .tagline {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    transition: all 0.3s ease;
    width: 100%;
}

header.collapsed .search-container {
    max-width: 400px;
    margin: 0 auto;
}

#searchInput {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s ease;
}

header.collapsed #searchInput {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
}

#searchInput:focus {
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.story-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateX(-50px);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.story-card.user-story::before {
    content: "Jouw verhaal";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--secondary);
    color: var(--dark);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.story-card.visible {
    opacity: 1;
    transform: translateX(0);
}

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

.story-image {
    height: 180px;
    width: 100%;
    object-fit: cover;
}

.story-content {
    padding: 1.5rem;
    position: relative;
}

.story-title {
    font-family: 'Fredoka One', cursive;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.story-preview {
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.delete-story-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 123, 156, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    z-index: 3;
}

.story-card:hover .delete-story-btn {
    opacity: 1;
}

.delete-story-btn:hover {
    background-color: #ff4d7a;
    transform: scale(1.1);
}

.create-story-btn {
    display: block;
    margin: 2rem auto 3rem;
    padding: 1rem 2rem;
    background-color: var(--secondary);
    color: var(--dark);
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.create-story-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: scale(1.05);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: 'Fredoka One', cursive;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: var(--dark);
}

footer {
    background-color: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.story-page {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.story-page img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.story-page h1 {
    color: var(--accent);
    text-align: left;
}

.back-button {
    display: inline-block;
    margin-top: 2rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
}

.back-button:hover {
    text-decoration: underline;
}

.delete-confirm-modal {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.delete-confirm-modal h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-family: 'Fredoka One', cursive;
}

.delete-confirm-modal p {
    margin-bottom: 1.5rem;
    color: #666;
}

.delete-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-danger {
    background-color: #ff4d7a;
    color: white;
}

.btn-danger:hover {
    background-color: #ff3366;
}

@media (max-width: 768px) {
    :root {
        --header-height: 160px;
        --header-collapsed-height: 70px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    header.collapsed h1 {
        font-size: 1.3rem;
    }
    
    .stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    header.collapsed .search-container {
        max-width: 300px;
    }
}
