* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }
body { background-color: #f4f6f8; color: #333; }

.app-header {
    background: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

/* Obsługa widoków */
.view-section { display: block; }
.view-section.hidden { display: none !important; }

/* Karta Logowania */
.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 400px;
    margin: 4rem auto;
}
.login-card h2 { margin-bottom: 1.5rem; text-align: center; color: #1a202c; }
.error-msg { color: #e53e3e; font-size: 0.85rem; margin-bottom: 1rem; text-align: center; }

.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.mb-1 { margin-bottom: 1rem; }
.divider { border: 0; height: 1px; background: #e2e8f0; margin: 2rem 0; }

.project-detail-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.input-title { font-size: 1.25rem; font-weight: 600; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-summary-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.project-summary-card h3 { margin-bottom: 0.5rem; color: #1a202c; }
.project-summary-card p {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-meta { font-size: 0.8rem; color: #a0aec0; margin-bottom: 1rem; }

.drop-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    background: #f7fafc;
    color: #718096;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s, border-color 0.2s;
}
.drop-zone.dragover { background: #ebf8ff; border-color: #3182ce; color: #2b6cb0; }

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.image-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    cursor: pointer;
}
.image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.image-wrapper:hover img { transform: scale(1.05); }

.image-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.image-wrapper:hover .image-overlay { opacity: 1; }

.btn-icon-action {
    background: white;
    color: #333;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.image-item textarea {
    border: none;
    padding: 0.5rem;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 50px;
    border-top: 1px solid #edf2f7;
    outline: none;
}

.btn-delete-img {
    position: absolute;
    top: 5px; right: 5px;
    background: rgba(229, 62, 62, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px; height: 24px;
    cursor: pointer;
    font-weight: bold;
    z-index: 2;
}

.btn { padding: 0.5rem 1rem; border-radius: 4px; border: none; cursor: pointer; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.primary { background: #3182ce; color: white; }
.btn.secondary { background: #e2e8f0; color: #4a5568; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; color: #4a5568; font-size: 0.9rem; }
.form-group input, .form-group textarea { width: 100%; padding: 0.6rem; border: 1px solid #cbd5e0; border-radius: 4px; font-size: 1rem; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal.hidden { display: none; }
.preview-content { background: white; padding: 2rem; border-radius: 8px; width: 100%; max-width: 800px; max-height: 90vh; display: flex; flex-direction: column; align-items: center; position: relative; }
.preview-image-wrapper { width: 100%; max-height: 65vh; display: flex; justify-content: center; align-items: center; overflow: hidden; background: #1a202c; border-radius: 6px; }
.preview-image-wrapper img { max-width: 100%; max-height: 65vh; object-fit: contain; }
.preview-caption { margin-top: 1rem; color: #4a5568; font-style: italic; text-align: center; }
.btn-close-preview { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 1.8rem; cursor: pointer; color: #718096; }