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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: #0a0a1a;
    background-image: url('brain-bg.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #e0e0e0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px 16px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 10, 26, 0.5) 0%,
        rgba(10, 10, 26, 0.7) 30%,
        rgba(10, 10, 26, 0.85) 60%,
        rgba(10, 10, 26, 0.95) 100%
    );
    z-index: 0;
}

#app {
    position: relative;
    z-index: 1;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header */
header {
    text-align: center;
    padding: 8px 0 4px;
}

header h1 {
    font-size: 28px;
    font-weight: 300;
    color: rgba(200, 210, 230, 0.9);
    letter-spacing: 2px;
}

header h1 .obsidian {
    font-weight: 700;
    background: linear-gradient(135deg, #5b9bd5 0%, #7b68ee 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#status {
    font-size: 11px;
    color: #555;
    margin-top: 2px;
}

/* Categories — glassmorphism cards */
#categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cat-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #c0c8d8;
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
}

.cat-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s;
}

.cat-btn[data-cat="dzien"]::before {
    background: linear-gradient(135deg, rgba(59, 107, 165, 0.3), rgba(80, 140, 200, 0.1));
}
.cat-btn[data-cat="mysl"]::before {
    background: linear-gradient(135deg, rgba(123, 104, 238, 0.3), rgba(150, 130, 255, 0.1));
}
.cat-btn[data-cat="problem"]::before {
    background: linear-gradient(135deg, rgba(230, 160, 50, 0.3), rgba(255, 190, 80, 0.1));
}
.cat-btn[data-cat="todo"]::before {
    background: linear-gradient(135deg, rgba(46, 160, 120, 0.3), rgba(70, 200, 150, 0.1));
}

.cat-btn:active,
.cat-btn.selected {
    transform: scale(0.96);
    border-color: rgba(255, 255, 255, 0.15);
}

.cat-btn.selected::before {
    opacity: 1;
}

.cat-btn.selected {
    box-shadow: 0 4px 20px rgba(59, 107, 165, 0.2);
}

.cat-icon {
    font-size: 32px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.cat-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* Text input */
textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #e0e0e0;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    min-height: 130px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    line-height: 1.5;
}

textarea:focus {
    border-color: rgba(59, 107, 165, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 107, 165, 0.1);
}

textarea::placeholder {
    color: #4a5068;
}

/* Link input */
input[type="text"] {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #e0e0e0;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    line-height: 1.5;
}

input[type="text"]:focus {
    border-color: rgba(59, 107, 165, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 107, 165, 0.1);
}

input[type="text"]::placeholder {
    color: #4a5068;
}

/* Media buttons */
#media-buttons {
    display: flex;
    gap: 12px;
}

#media-buttons button,
#media-buttons label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #8090b0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s;
}

#media-buttons button span:first-child,
#media-buttons label span:first-child {
    font-size: 24px;
    filter: drop-shadow(0 2px 6px rgba(59, 107, 165, 0.3));
}

#media-buttons button:active,
#media-buttons label:active {
    transform: scale(0.96);
}

#btn-record.recording {
    border-color: rgba(231, 76, 60, 0.5);
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

/* Previews */
#audio-preview,
#photo-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: rgba(59, 107, 165, 0.08);
    font-size: 14px;
    color: #8090b0;
}

#photo-preview img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.remove-btn {
    background: rgba(231, 76, 60, 0.15);
    border: none;
    color: #e74c3c;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.remove-btn:active {
    background: rgba(231, 76, 60, 0.3);
}

.hidden {
    display: none !important;
}

/* Submit */
#btn-submit {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #3B6BA5 0%, #4a80c0 50%, #5b9bd5 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 20px rgba(59, 107, 165, 0.3);
}

#btn-submit:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: #3a3f55;
    box-shadow: none;
    cursor: not-allowed;
}

#btn-submit:not(:disabled):active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(59, 107, 165, 0.4);
}

#btn-submit.sending {
    background: linear-gradient(135deg, #2d5a8a 0%, #3B6BA5 100%);
    pointer-events: none;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Toast */
#toast {
    position: fixed;
    bottom: 40px;
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    z-index: 100;
    animation: fadeInUp 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#toast.success {
    background: rgba(46, 160, 120, 0.9);
    color: white;
    border: 1px solid rgba(46, 160, 120, 0.3);
}

#toast.error {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
    display: none;
}
