/* === Liana — Still-Tracker === */
/* Pastellrosa, Einhand-optimiert, große Touch-Targets */

:root {
    --pink-50: #fce4ec;
    --pink-100: #f8bbd0;
    --pink-200: #f48fb1;
    --pink-300: #f06292;
    --pink-400: #ec407a;
    --pink-500: #e91e63;
    --pink-600: #d81b60;

    --warm-white: #fff8f9;
    --warm-gray: #f5f0f1;
    --text-primary: #4a2c3d;
    --text-secondary: #8a6b7a;
    --text-light: #b89aaa;

    --green-soft: #c8e6c9;
    --green-accent: #66bb6a;
    --yellow-soft: #fff9c4;
    --orange-soft: #ffe0b2;
    --red-soft: #ffcdd2;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 12px rgba(74, 44, 61, 0.08);
    --shadow-lg: 0 4px 24px rgba(74, 44, 61, 0.12);

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--warm-white);
    color: var(--text-primary);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Screens === */
.screen {
    display: none;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(24px + var(--safe-bottom));
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* === Login === */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    gap: 8px;
}

.app-logo {
    font-size: 64px;
    margin-bottom: 8px;
}

.login-container h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--pink-500);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

.pin-wrapper {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#pin-input {
    width: 100%;
    text-align: center;
    font-size: 28px;
    letter-spacing: 8px;
    padding: 16px;
    border: 2px solid var(--pink-100);
    border-radius: var(--radius);
    background: white;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

#pin-input:focus {
    border-color: var(--pink-400);
}

.error {
    color: var(--pink-500);
    font-size: 14px;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* === Header === */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(16px + var(--safe-top)) 20px 12px;
    background: var(--pink-50);
    border-bottom: 1px solid var(--pink-100);
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--pink-600);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink-400), var(--pink-500));
    color: white;
    padding: 14px 28px;
    box-shadow: var(--shadow);
}

.btn-primary:active {
    background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
}

.btn-large {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    border-radius: var(--radius);
    min-height: 56px;
}

.btn-danger {
    background: var(--red-soft);
    color: #c62828;
    padding: 14px 28px;
    margin-top: 8px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 22px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:active {
    background: var(--pink-100);
}

/* === FAB (Haupt-Aktion) === */
.btn-fab {
    margin: 20px;
    padding: 20px;
    font-size: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-height: 64px;
}

/* === Summary Card === */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px 20px 0;
    box-shadow: var(--shadow);
}

.summary-card {
    border-left: 4px solid var(--pink-300);
}

.summary-card.compact {
    margin: 0 20px;
    padding: 16px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.summary-date {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-stat {
    font-size: 14px;
    color: var(--pink-500);
    font-weight: 700;
    background: var(--pink-50);
    padding: 4px 12px;
    border-radius: 20px;
}

.summary-details {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.summary-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-timer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--warm-gray);
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
}

.summary-timer strong {
    color: var(--pink-500);
}

/* === Entries List === */
.entries-list {
    padding: 0 20px 20px;
}

.entry-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.1s;
}

.entry-card:active {
    transform: scale(0.98);
}

.entry-time {
    font-size: 18px;
    font-weight: 700;
    color: var(--pink-500);
    min-width: 54px;
}

.entry-details {
    flex: 1;
}

.entry-meta {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: center;
}

.entry-side {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--pink-50);
    color: var(--pink-500);
}

.entry-duration {
    font-weight: 600;
}

.entry-rating {
    font-size: 20px;
}

.entry-note-preview {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* === Entry Form === */
.entry-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.optional {
    font-weight: 400;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    border: 2px solid var(--warm-gray);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--pink-300);
}

textarea.form-control {
    font-size: 16px;
    resize: none;
    font-family: inherit;
}

/* Duration Grid */
.duration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.btn-duration {
    padding: 14px;
    font-size: 18px;
    font-weight: 700;
    border: 2px solid var(--pink-100);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    min-height: 50px;
    transition: all 0.15s;
}

.btn-duration.selected {
    background: var(--pink-400);
    color: white;
    border-color: var(--pink-400);
}

.btn-duration:active {
    transform: scale(0.95);
}

.duration-input {
    text-align: center;
    font-weight: 600;
}

/* Side Toggle */
.side-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.btn-side {
    padding: 16px 8px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--pink-100);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    min-height: 52px;
    transition: all 0.15s;
}

.btn-side.selected {
    background: var(--pink-400);
    color: white;
    border-color: var(--pink-400);
}

.btn-side:active {
    transform: scale(0.95);
}

/* Rating Grid */
.rating-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn-rating {
    padding: 12px;
    font-size: 32px;
    border: 2px solid var(--warm-gray);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    min-height: 60px;
    transition: all 0.15s;
}

.btn-rating.selected {
    border-color: var(--pink-400);
    background: var(--pink-50);
    transform: scale(1.08);
}

.btn-rating:active {
    transform: scale(0.92);
}

/* Save Button */
.btn-save {
    margin-top: 8px;
}

/* === Date Navigation (Historie) === */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 20px;
}

.btn-nav {
    font-size: 20px;
    min-width: 50px;
    min-height: 50px;
}

.date-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 160px;
    text-align: center;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-state .emoji {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
}

/* === Animationen === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen.active {
    animation: fadeIn 0.2s ease-out;
}

/* === PWA Standalone Mode === */
@media (display-mode: standalone) {
    .app-header {
        padding-top: calc(48px + var(--safe-top));
    }
}

/* === Landscape / Tablet === */
@media (min-width: 500px) {
    .entry-form,
    .entries-list,
    .card {
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
    }

    .btn-fab {
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
}
