/* intellinote.de - Colorful Minimalist Design inspired by kita-eule.de */

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

/* Color System - Warm & Friendly */
:root {
    /* Primary Colors */
    --primary: #FF9500;        /* Warm Orange */
    --primary-light: #FFB340;
    --primary-dark: #E68600;
    
    /* Accent Colors */
    --accent-green: #34C759;   /* Success Green */
    --accent-blue: #007AFF;    /* Info Blue */
    --accent-purple: #AF52DE;  /* Creative Purple */
    --accent-red: #FF3B30;     /* Alert Red */
    --accent-yellow: #FFCC00;  /* Highlight Yellow */
    
    /* Neutral Colors */
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --text: #1D1D1F;
    --text-secondary: #6E6E73;
    --border: #E5E5E7;
    --shadow: rgba(0, 0, 0, 0.08);
    
    /* Spacing */
    --radius: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Colorful & Friendly */
.header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    padding-top: calc(1rem + env(safe-area-inset-top));
    z-index: 100;
    box-shadow: 0 4px 16px var(--shadow);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    /* Remove white background using mix-blend-mode */
    mix-blend-mode: multiply;
    background: transparent;
}

/* Removed theme-toggle - no dark mode */

/* Main Content */
.main {
    flex: 1;
    padding: 2rem 1.5rem;
    padding-bottom: calc(6rem + env(safe-area-inset-bottom));
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Filter Chips - Playful Colors */
.filter-chips {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 8px var(--shadow);
}

.chip:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.chip.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 149, 0, 0.3);
}

/* Notes Grid - Card Layout */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .notes-grid {
        grid-template-columns: 1fr;
    }
}

/* Note Cards - Colorful & Elevated */
.note-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    box-shadow: 0 2px 12px var(--shadow);
    position: relative;
    overflow: hidden;
}

.note-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent-purple) 50%, var(--accent-blue) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
    border-color: var(--primary-light);
}

.note-card:hover::before {
    opacity: 1;
}

.note-card:active {
    transform: translateY(-2px);
}

.note-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: var(--radius);
    font-size: 1.75rem;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.2);
}

.note-body {
    flex: 1;
    min-width: 0;
}

.note-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.note-summary {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}

.note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    padding: 0.35rem 0.75rem;
    background: var(--accent-green);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(52, 199, 89, 0.3);
}

.timestamp {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* FAB - Bright & Inviting */
.fab {
    position: fixed;
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    right: 1.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
    transition: all 0.3s;
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 12px 32px rgba(0, 122, 255, 0.5);
}

.fab:active {
    transform: scale(1.05) rotate(90deg);
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.3s;
    z-index: 200;
    box-shadow: 0 -8px 32px var(--shadow);
    max-height: 85vh;
    overflow-y: auto;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 199;
}

.sheet-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    margin: 0 auto 1.5rem;
}

.sheet-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.sheet-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sheet-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.sheet-content {
    display: none;
}

.sheet-content.active {
    display: block;
}

/* Forms - Clean & Modern */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--surface);
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.1);
}

button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-green) 0%, #2FB84B 100%);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 199, 89, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* Recording UI */
.recording-controls {
    text-align: center;
    padding: 2rem 0;
}

.record-visualizer {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    position: relative;
    display: none;
}

.record-visualizer.active {
    display: block;
}

/* Waveform Animation */
.waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 80px;
    margin: 2rem auto;
    display: none;
}

.waveform.active {
    display: flex;
}

.waveform-bar {
    width: 4px;
    background: linear-gradient(180deg, var(--accent-red) 0%, var(--primary) 100%);
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.waveform-bar:nth-child(1) { height: 20px; animation-delay: 0s; }
.waveform-bar:nth-child(2) { height: 40px; animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { height: 60px; animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { height: 80px; animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { height: 60px; animation-delay: 0.4s; }
.waveform-bar:nth-child(6) { height: 40px; animation-delay: 0.5s; }
.waveform-bar:nth-child(7) { height: 20px; animation-delay: 0.6s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.5); opacity: 0.7; }
    50% { transform: scaleY(1); opacity: 1; }
}

.record-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-red);
    margin: 1rem 0;
    font-variant-numeric: tabular-nums;
}

.btn-record {
    width: auto;
    min-width: 200px;
    padding: 1.25rem 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--accent-red) 0%, #E63023 100%);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(255, 59, 48, 0.4);
    margin: 1rem auto;
}

.btn-record:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 59, 48, 0.5);
}

.btn-record:active {
    transform: translateY(0);
}

.btn-record.recording {
    background: linear-gradient(135deg, #E63023 0%, #CC2915 100%);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 8px 24px rgba(255, 59, 48, 0.4); }
    50% { box-shadow: 0 8px 32px rgba(255, 59, 48, 0.8), 0 0 40px rgba(255, 59, 48, 0.3); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: calc(1rem + env(safe-area-inset-top));
    right: 1rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px var(--shadow);
    color: var(--text);
    font-weight: 600;
    border-left: 4px solid var(--accent-green);
    animation: slideIn 0.3s;
}

.toast.error {
    border-left-color: var(--accent-red);
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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