/* WakeFactory Timetracker - Styles v2.1 */

:root {
    --primary: #00bcd4;
    --primary-dark: #0097a7;
    --secondary: #1a5276;
    --bg-light: #e8f4f8;
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-muted: #666666;
    --border: #dddddd;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    padding-bottom: 80px;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
    background: var(--bg-white);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    height: 36px;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.header-actions a {
    color: var(--secondary);
    font-size: 24px;
    text-decoration: none;
}

/* Page Title Bar */
.page-title {
    background: var(--secondary);
    color: white;
    padding: 14px 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

/* Container */
.container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    background: var(--bg-light);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.card-header .date {
    color: var(--secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header .total {
    color: var(--primary);
    font-weight: 600;
}

.card-body {
    padding: 0;
}

.card-body.collapsed {
    display: none;
}

/* Entry Row */
.entry-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.entry-row:last-child {
    border-bottom: none;
}

.entry-row .name {
    font-weight: 500;
}

.entry-row .duration {
    color: var(--text-muted);
}

/* Table Header */
.table-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    background: #f5f5f5;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
}

/* ========== FORMS - EINHEITLICH ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Basis-Style für ALLE Formularfelder */
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-white);
    color: var(--text-dark);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* iOS/Safari Fix für date/time inputs */
input[type="date"].form-control,
input[type="time"].form-control {
    min-height: 48px;
    line-height: 1.4;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

/* Placeholder-Farbe einheitlich */
.form-control::placeholder {
    color: #999;
    opacity: 1;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Select Dropdown */
select.form-control {
    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='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    color: var(--text-dark);
}

/* Readonly Felder (z.B. Dauer) */
.form-control[readonly] {
    background-color: #f8f9fa;
    color: var(--text-dark);
}

/* Focus State */
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,188,212,0.1);
}

/* Form Row (zwei Felder nebeneinander) */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0,188,212,0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,188,212,0.5);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: 0 4px 15px rgba(255,152,0,0.4);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(244,67,54,0.4);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(76,175,80,0.4);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-wrapper {
    text-align: center;
    margin-top: 24px;
}

/* Button Gruppe (nebeneinander) */
.btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.btn-group .btn {
    flex: 1;
    max-width: 160px;
}

/* ========== TIMER DISPLAY ========== */
.timer-display {
    text-align: center;
    padding: 20px 20px 10px;
}

.timer-circle {
    width: 240px;
    height: 240px;
    border: 6px solid var(--primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: var(--bg-white);
    box-shadow: 0 4px 20px rgba(0,188,212,0.2);
    transition: all 0.3s ease;
}

.timer-circle.running {
    border-color: var(--danger);
    animation: pulse 2s infinite;
}

.timer-circle.paused {
    border-color: var(--warning);
    animation: none;
}

.timer-circle.saved {
    border-color: var(--success);
    animation: none;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(244,67,54,0.2); }
    50% { box-shadow: 0 4px 30px rgba(244,67,54,0.4); }
}

.timer-label {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.timer-circle.running .timer-label {
    color: var(--danger);
}

.timer-circle.paused .timer-label {
    color: var(--warning);
}

.timer-circle.saved .timer-label {
    color: var(--success);
}

.timer-value {
    font-size: 38px;
    font-weight: 400;
    color: var(--secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', 'Menlo', monospace;
    letter-spacing: 2px;
}

.timer-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-circle.running .timer-status {
    color: var(--danger);
}

.timer-circle.paused .timer-status {
    color: var(--warning);
}

.timer-circle.saved .timer-status {
    color: var(--success);
}

/* Timer Buttons */
.timer-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 16px 0;
    min-height: 52px;
}

.timer-buttons .btn {
    min-width: 140px;
}

/* Mitglieder-Liste für heute */
.members-today {
    margin-bottom: 20px;
    margin-top: 10px;
}

.members-today-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.members-today-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.member-chip:hover {
    border-color: var(--primary);
    background: rgba(0,188,212,0.05);
}

.member-chip.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.member-chip-empty {
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 0;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    gap: 4px;
}

.bottom-nav a.active {
    color: var(--primary);
}

.bottom-nav a .icon {
    font-size: 22px;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-light) 0%, #cce7ed 100%);
}

.login-box {
    background: var(--bg-white);
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 360px;
}

.login-box .logo {
    display: block;
    margin: 0 auto 30px;
    height: 50px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--secondary);
    font-size: 20px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-danger {
    background: #ffebee;
    color: var(--danger);
    border: 1px solid #ffcdd2;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success);
    border: 1px solid #c8e6c9;
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow);
}

.autocomplete-list div {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.autocomplete-list div:hover {
    background: var(--bg-light);
}

.autocomplete-list div:last-child {
    border-bottom: none;
}

/* Member badge/tag */
.member-selected {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    padding: 8px 12px;
    border-radius: 20px;
    margin-top: 8px;
}

.member-selected .remove {
    cursor: pointer;
    color: var(--danger);
    font-weight: bold;
}

/* Responsive */
@media (min-width: 768px) {
    .container {
        padding: 24px;
    }
    
    .timer-circle {
        width: 280px;
        height: 280px;
    }
    
    .timer-value {
        font-size: 46px;
    }
}

/* Kleiner Screen */
@media (max-width: 360px) {
    .timer-circle {
        width: 200px;
        height: 200px;
    }
    
    .timer-value {
        font-size: 32px;
    }
    
    .timer-buttons .btn {
        min-width: 110px;
        padding: 12px 16px;
        font-size: 12px;
    }
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Version Info */
.version-info {
    text-align: center;
    font-size: 11px;
    color: #999;
    padding: 8px;
    margin-top: 16px;
}

/* Version im eingeloggten Bereich (über Bottom-Nav) */
body:not(.login-wrapper) .version-info {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    padding: 4px;
    margin: 0;
    background: transparent;
    pointer-events: none;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 200;
    animation: toastIn 0.3s ease;
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
