/* Letter From Past - Styly */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.5;
}
a { color: #a78bfa; text-decoration: none; }
a:hover { color: #c4b5fd; }
img { max-width: 100%; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* === LANDING PAGE === */
.landing {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}
.landing-content { max-width: 640px; }
.landing-icon {
    width: 80px; height: 80px;
    background: rgba(139,92,246,0.2);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}
.landing-icon svg { width: 40px; height: 40px; color: #a78bfa; }
.landing h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.landing-divider {
    width: 64px; height: 2px;
    background: #8b5cf6;
    margin: 0 auto 24px;
}
.landing .subtitle {
    font-size: 1.25rem;
    color: rgba(196,181,253,0.8);
    font-weight: 300;
    margin-bottom: 16px;
}
.landing .description {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 48px;
    line-height: 1.7;
}
.landing .note {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 32px;
}

/* === LOGIN PAGE === */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-box {
    width: 100%;
    max-width: 420px;
}
.login-box .title {
    text-align: center;
    margin-bottom: 32px;
}
.login-box .title h1 {
    font-size: 1.875rem;
    font-weight: 300;
    color: #fff;
    margin-bottom: 8px;
}
.login-box .title p { color: #94a3b8; }
.login-card {
    background: rgba(30,41,59,0.5);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid rgba(51,65,85,0.5);
}

/* === FORMULÁŘOVÉ PRVKY === */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15,23,42,0.5);
    border: 1px solid #475569;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: #8b5cf6;
}
.form-control::placeholder { color: #64748b; }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}
.form-check input[type="checkbox"] {
    width: 20px; height: 20px;
    border-radius: 4px;
    background: rgba(15,23,42,0.5);
    border: 1px solid #475569;
    accent-color: #8b5cf6;
    flex-shrink: 0;
    margin-top: 2px;
}
.form-check-label { color: #cbd5e1; }
.form-subfield {
    margin-top: 8px;
    padding-left: 0;
}
.form-subfield .form-control {
    font-size: 0.875rem;
    padding: 8px 12px;
}
.form-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.form-inline .form-control { width: 80px; }
.form-inline span { color: #94a3b8; font-size: 0.875rem; }

/* === TLAČÍTKA === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 8px;
    text-decoration: none;
}
.btn svg { width: 20px; height: 20px; }
.btn-primary {
    background: #7c3aed;
    color: #fff;
    box-shadow: 0 4px 14px rgba(124,58,237,0.25);
}
.btn-primary:hover { background: #6d28d9; color: #fff; box-shadow: 0 4px 20px rgba(124,58,237,0.4); }
.btn-secondary { background: #334155; color: #fff; }
.btn-secondary:hover { background: #475569; color: #fff; }
.btn-danger { background: rgba(239,68,68,0.2); color: #f87171; }
.btn-danger:hover { background: rgba(239,68,68,0.3); }
.btn-ghost { background: transparent; color: #94a3b8; }
.btn-ghost:hover { color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 16px 32px; font-size: 1.125rem; }
.btn-block { width: 100%; }

/* === HEADER === */
.header {
    background: rgba(30,41,59,0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #1e293b;
    position: sticky;
    top: 0;
    z-index: 40;
}
.header-inner {
    max-width: 1152px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.header-logo-icon {
    width: 40px; height: 40px;
    background: rgba(139,92,246,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-logo-icon svg { width: 20px; height: 20px; color: #a78bfa; }
.header-logo span {
    font-size: 1.25rem;
    font-weight: 300;
    color: #fff;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.875rem;
}
.header-user .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
}
.dot-admin { background: #f59e0b; }
.dot-user { background: #10b981; }
.header-logout {
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
}
.header-logout:hover { color: #fff; }
.header-logout svg { width: 20px; height: 20px; }

/* === OBSAH === */
.content {
    max-width: 1152px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* === STATISTIKY === */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: rgba(30,41,59,0.5);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(51,65,85,0.5);
}
.stat-label { color: #94a3b8; font-size: 0.875rem; margin-bottom: 4px; }
.stat-value { font-size: 1.5rem; font-weight: 600; color: #fff; }
.stat-value.purple { color: #a78bfa; }
.stat-value.green { color: #34d399; }
.stat-value.amber { color: #fbbf24; }

/* === AKCE === */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

/* === ZÁLOŽKY === */
.tabs {
    display: flex;
    gap: 4px;
    background: rgba(30,41,59,0.3);
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
    margin-bottom: 24px;
}
.tab {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.tab:hover { color: #fff; }
.tab.active { background: #7c3aed; color: #fff; }

/* === SEZNAM ZPRÁV === */
.message-list { display: flex; flex-direction: column; gap: 12px; }
.message-card {
    background: rgba(30,41,59,0.5);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(51,65,85,0.5);
    transition: border-color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
}
.message-card:hover { border-color: rgba(139,92,246,0.5); color: inherit; }
.message-card-content { flex: 1; }
.message-card h3 {
    font-size: 1.125rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.message-card:hover h3 { color: #c4b5fd; }
.message-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.875rem;
    color: #94a3b8;
}
.message-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.message-card-meta svg { width: 16px; height: 16px; }
.message-card-arrow {
    color: #475569;
    transition: color 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
    margin-top: 4px;
}
.message-card:hover .message-card-arrow { color: #a78bfa; }
.message-card-arrow svg { width: 20px; height: 20px; }

/* === ODZNÁČKY === */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-locked { background: rgba(245,158,11,0.2); color: #fbbf24; }
.badge-password { background: rgba(244,63,94,0.2); color: #fb7185; }
.badge-reply { background: rgba(16,185,129,0.2); color: #34d399; }
.badge-draft { background: #475569; color: #cbd5e1; }
.badge-scheduled { background: rgba(139,92,246,0.2); color: #a78bfa; }
.badge-sent { background: rgba(16,185,129,0.2); color: #34d399; }

/* === PRÁZDNÝ STAV === */
.empty-state {
    text-align: center;
    padding: 48px 0;
    color: #64748b;
}

/* === MODÁLY === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 50;
    overflow-y: auto;
}
.modal-container {
    min-height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    padding-top: 32px;
    padding-bottom: 32px;
}
.modal {
    background: #1e293b;
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    border: 1px solid #334155;
    margin: auto;
}
.modal-header {
    padding: 24px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.modal-header h2 { font-size: 1.25rem; font-weight: 600; color: #fff; }
.modal-close {
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
}
.modal-close:hover { color: #fff; }
.modal-close svg { width: 24px; height: 24px; }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 24px;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.modal-footer-split {
    display: flex;
    justify-content: space-between;
}

/* === DETAIL ZPRÁVY === */
.detail-section { margin-bottom: 20px; }
.detail-label { font-size: 0.875rem; color: #94a3b8; margin-bottom: 4px; }
.detail-value { color: #e2e8f0; }
.detail-text {
    background: rgba(15,23,42,0.5);
    border-radius: 8px;
    padding: 16px;
    color: #e2e8f0;
    white-space: pre-wrap;
    line-height: 1.6;
}
.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15,23,42,0.5);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}
.attachment-item svg { width: 20px; height: 20px; color: #a78bfa; flex-shrink: 0; }
.attachment-item span { color: #e2e8f0; }
.attachment-item .file-size { color: #64748b; font-size: 0.75rem; margin-left: auto; }
.reply-item {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}
.reply-item p { color: #e2e8f0; margin-bottom: 8px; }
.reply-item .reply-date { font-size: 0.75rem; color: #64748b; }

/* === WEBOVÁ VERZE (pro příjemce) === */
.web-view {
    min-height: 100vh;
    background: #f9fafb;
    padding: 24px;
}
.web-view-card {
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.web-view-header {
    background: linear-gradient(135deg, #1e1b4b, #581c87);
    padding: 40px;
    text-align: center;
}
.web-view-header .icon {
    width: 64px; height: 64px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.web-view-header .icon svg { width: 32px; height: 32px; color: #c4b5fd; }
.web-view-header h1 { color: #fff; font-size: 1.5rem; font-weight: 600; margin-bottom: 8px; }
.web-view-header p { color: #c4b5fd; font-size: 0.875rem; }
.web-view-body { padding: 32px; }
.web-view-text {
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
    color: #374151;
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 24px;
}
.web-view-attachments { margin-bottom: 32px; }
.web-view-attachments h3 { font-size: 0.875rem; font-weight: 500; color: #6b7280; margin-bottom: 12px; }
.web-view-att-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: #374151;
}
.web-view-att-item:hover { background: #f3f4f6; color: #374151; }
.web-view-att-item svg { width: 20px; height: 20px; color: #7c3aed; }
.web-view-reply {
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}
.web-view-reply h3 { font-size: 0.875rem; font-weight: 500; color: #6b7280; margin-bottom: 12px; }
.web-view-reply textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
}
.web-view-reply textarea:focus { outline: none; border-color: #7c3aed; }
.web-view-reply .btn { margin-top: 12px; }
.web-view-footer {
    background: #f9fafb;
    padding: 16px;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    border-top: 1px solid #e5e7eb;
}

/* === HESLO FORMULÁŘ (webová verze) === */
.password-form {
    text-align: center;
    padding: 40px 32px;
}
.password-form .lock-icon {
    width: 64px; height: 64px;
    background: rgba(245,158,11,0.1);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.password-form .lock-icon svg { width: 32px; height: 32px; color: #f59e0b; }
.password-form p { color: #6b7280; margin-bottom: 20px; }
.password-form .form-control {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    color: #374151;
    max-width: 300px;
    margin: 0 auto 16px;
}
.password-form .form-control:focus { border-color: #7c3aed; }

/* === UPLOAD ZÓNA === */
.upload-zone {
    border: 2px dashed #475569;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
}
.upload-zone:hover { border-color: #8b5cf6; }
.upload-zone svg { width: 32px; height: 32px; color: #64748b; margin: 0 auto 8px; }
.upload-zone p { color: #94a3b8; font-size: 0.875rem; }
.upload-zone .hint { color: #64748b; font-size: 0.75rem; margin-top: 4px; }
.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.upload-preview {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.upload-file {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15,23,42,0.5);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
}
.upload-file span { flex: 1; color: #e2e8f0; }
.upload-file .remove {
    color: #f87171;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0 4px;
}

/* === NOTIFIKAČNÍ SEKCE === */
.notification-section {
    background: rgba(15,23,42,0.5);
    border-radius: 8px;
    padding: 16px;
}
.notification-section h3 { font-weight: 500; color: #fff; margin-bottom: 16px; }

/* === FLASH ZPRÁVY === */
.flash {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 0.875rem;
}
.flash-success { background: rgba(16,185,129,0.2); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.flash-error { background: rgba(239,68,68,0.2); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.flash-info { background: rgba(59,130,246,0.2); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

/* === TABULKA UŽIVATELŮ === */
.user-card {
    background: rgba(15,23,42,0.5);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.user-info .user-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.user-info .user-name span { font-weight: 500; color: #fff; }
.user-info .user-email { font-size: 0.875rem; color: #94a3b8; }
.user-info .user-date { font-size: 0.75rem; color: #64748b; margin-top: 4px; }
.user-actions { display: flex; gap: 8px; }
.user-actions button {
    padding: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
}
.user-actions button:hover { color: #fff; background: rgba(255,255,255,0.05); }
.user-actions button.delete:hover { color: #f87171; }
.user-actions button svg { width: 20px; height: 20px; }

/* === WEBOVÁ VERZE - EXISTUJÍCÍ ODPOVĚDI === */
.web-view-existing-replies { margin-bottom: 24px; }
.web-view-existing-replies h3 { font-size: 0.875rem; font-weight: 500; color: #6b7280; margin-bottom: 12px; }
.web-reply-item {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 8px;
}
.web-reply-item p { color: #374151; margin-bottom: 4px; }
.web-reply-item .date { font-size: 0.75rem; color: #9ca3af; }

/* === RESPONZIVITA === */
@media (max-width: 768px) {
    .landing h1 { font-size: 2rem; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .header-inner { padding: 12px 16px; }
    .header-logo span { display: none; }
    .content { padding: 24px 16px; }
    .message-card { padding: 16px; }
    .message-card-meta { gap: 8px; }
    .modal { margin: 16px; }
    .modal-header, .modal-body, .modal-footer { padding: 16px; }
    .user-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .tabs { overflow-x: auto; width: 100%; }
    .btn-lg { padding: 12px 24px; font-size: 1rem; }
    .web-view-body { padding: 24px 16px; }
    .modal-footer { flex-wrap: wrap; }
    .modal-footer .btn { flex: 1; min-width: 120px; }
    .modal-footer-split { flex-direction: column-reverse; gap: 12px; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 1.25rem; }
    .actions { flex-direction: column; }
    .actions .btn { width: 100%; }
}
