/* ==========================================================================
   Simple Editor - Hauszmann Alapítvány
   ========================================================================== */

:root {
    --editor-primary: #2d5a3d;
    --editor-primary-dark: #1e3d29;
    --editor-primary-light: #3a7a50;
    --editor-accent: #c4a35a;
    --editor-accent-dark: #a88a42;
    --editor-text: #2c2c2c;
    --editor-text-light: #666666;
    --editor-text-muted: #888888;
    --editor-bg: #ffffff;
    --editor-bg-alt: #f8f7f5;
    --editor-border: #e5e5e5;
    --editor-error: #dc3545;
    --editor-success: #28a745;
    --editor-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --editor-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --editor-radius: 8px;
    --editor-radius-lg: 12px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Base */
.editor-page {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--editor-text);
    background: var(--editor-bg-alt);
    min-height: 100vh;
}

/* ==========================================================================
   Login Page
   ========================================================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--editor-primary) 0%, var(--editor-primary-dark) 100%);
}

.login-box {
    background: white;
    border-radius: var(--editor-radius-lg);
    box-shadow: var(--editor-shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    height: 60px;
    margin-bottom: 1.5rem;
}

.login-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: var(--editor-primary);
    margin: 0 0 0.5rem;
}

.login-header p {
    color: var(--editor-text-light);
    margin: 0;
    font-size: 0.95rem;
}

.login-form {
    margin-top: 1.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--editor-border);
}

.login-footer a {
    color: var(--editor-text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.login-footer a:hover {
    color: var(--editor-primary);
}

/* ==========================================================================
   Header
   ========================================================================== */

.editor-header {
    background: white;
    box-shadow: var(--editor-shadow);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 40px;
}

.header-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--editor-primary);
    font-weight: 600;
}

.header-center {
    flex: 1;
    text-align: center;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--editor-text);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--editor-text-light);
    font-size: 0.9rem;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--editor-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link svg {
    width: 20px;
    height: 20px;
}

.back-link:hover {
    color: var(--editor-primary);
}

/* ==========================================================================
   Main Content
   ========================================================================== */

.editor-main {
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 140px);
}

.editor-container {
    max-width: 1000px;
    margin: 0 auto;
}

.editor-container.narrow {
    max-width: 700px;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.welcome-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.welcome-section h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--editor-text);
    margin: 0 0 0.5rem;
}

.welcome-section p {
    color: var(--editor-text-light);
    font-size: 1.1rem;
    margin: 0;
}

/* Action Cards */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.action-card {
    background: white;
    border-radius: var(--editor-radius-lg);
    box-shadow: var(--editor-shadow);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--editor-shadow-lg);
    border-color: var(--editor-primary);
}

.card-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: var(--editor-bg-alt);
    border-radius: var(--editor-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--editor-primary);
}

.card-icon svg {
    width: 30px;
    height: 30px;
}

.action-card:hover .card-icon {
    background: var(--editor-primary);
    color: white;
}

.card-content {
    flex: 1;
}

.card-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin: 0 0 0.25rem;
    color: var(--editor-text);
}

.card-content p {
    color: var(--editor-text-light);
    margin: 0;
    font-size: 0.9rem;
}

.card-arrow {
    flex-shrink: 0;
    color: var(--editor-text-muted);
    transition: transform 0.3s;
}

.card-arrow svg {
    width: 24px;
    height: 24px;
}

.action-card:hover .card-arrow {
    transform: translateX(4px);
    color: var(--editor-primary);
}

/* Recent Section */
.recent-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.recent-block {
    background: white;
    border-radius: var(--editor-radius-lg);
    box-shadow: var(--editor-shadow);
    padding: 1.5rem;
}

.recent-block h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--editor-text);
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--editor-border);
}

.recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--editor-border);
}

.recent-list li:last-child {
    border-bottom: none;
}

.item-title {
    flex: 1;
    font-size: 0.95rem;
    color: var(--editor-text);
}

.item-date {
    color: var(--editor-text-muted);
    font-size: 0.85rem;
}

.empty-state {
    color: var(--editor-text-muted);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Help Section */
.help-section {
    background: white;
    border-radius: var(--editor-radius-lg);
    box-shadow: var(--editor-shadow);
    padding: 1.5rem;
}

.help-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--editor-text);
    margin: 0 0 1rem;
}

.help-content {
    display: grid;
    gap: 0.75rem;
}

.help-item {
    font-size: 0.9rem;
    color: var(--editor-text-light);
    line-height: 1.5;
}

.help-item strong {
    color: var(--editor-text);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.content-form {
    background: white;
    border-radius: var(--editor-radius-lg);
    box-shadow: var(--editor-shadow);
    padding: 2rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--editor-text);
}

.required {
    color: var(--editor-error);
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--editor-border);
    border-radius: var(--editor-radius);
    background: white;
    color: var(--editor-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--editor-primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
}

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

.help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--editor-text-muted);
}

/* File Upload */
.file-upload,
.multi-file-upload {
    position: relative;
    border: 2px dashed var(--editor-border);
    border-radius: var(--editor-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.file-upload:hover,
.file-upload.dragover,
.multi-file-upload:hover,
.multi-file-upload.dragover {
    border-color: var(--editor-primary);
    background: rgba(45, 90, 61, 0.02);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--editor-text-light);
}

.upload-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--editor-text-muted);
}

.upload-placeholder small {
    color: var(--editor-text-muted);
    font-size: 0.85rem;
}

.upload-preview {
    position: relative;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--editor-radius);
}

.remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: var(--editor-error);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.preview-item {
    position: relative;
}

.preview-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--editor-radius);
}

.preview-label {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--editor-text-muted);
    margin-top: 0.25rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--editor-border);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--editor-radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn svg {
    width: 20px;
    height: 20px;
}

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

.btn-primary:hover {
    background: var(--editor-primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--editor-text);
    border: 2px solid var(--editor-border);
}

.btn-outline:hover {
    border-color: var(--editor-primary);
    color: var(--editor-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.messages {
    margin-bottom: 1.5rem;
}

.message {
    padding: 1rem 1.25rem;
    border-radius: var(--editor-radius);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.editor-footer {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-top: 1px solid var(--editor-border);
}

.editor-footer a {
    color: var(--editor-text-light);
    text-decoration: none;
    font-size: 0.9rem;
}

.editor-footer a:hover {
    color: var(--editor-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .editor-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-center {
        order: -1;
        flex: 0 0 100%;
        text-align: left;
    }

    .editor-main {
        padding: 1.5rem 1rem;
    }

    .action-cards {
        grid-template-columns: 1fr;
    }

    .action-card {
        padding: 1.5rem;
    }

    .recent-section {
        grid-template-columns: 1fr;
    }

    .content-form {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .login-box {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .welcome-section h1 {
        font-size: 1.5rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
    }

    .card-icon svg {
        width: 24px;
        height: 24px;
    }

    .card-content h2 {
        font-size: 1.1rem;
    }
}
