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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000000;
    background-image:
        linear-gradient(0deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: #ffffff;
    margin-bottom: 60px;
    padding-top: 20px;
}

header h1 {
    font-size: 3.5em;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1em;
    color: #9ca3af;
    font-weight: 400;
}

.back-link {
    display: inline-block;
    color: #3b82f6;
    text-decoration: none;
    margin-top: 10px;
    font-size: 1em;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: #2563eb;
}

.main-content {
    background: transparent;
    padding: 40px 20px;
}

/* Recording Section */
.recording-section {
    text-align: center;
    padding: 40px 20px;
}

.record-button-container {
    margin-bottom: 40px;
}

.record-button {
    background: #ffffff;
    border: 1px solid #374151;
    border-radius: 50%;
    width: 180px;
    height: 180px;
    color: #000000;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-weight: 500;
}

.record-button:hover {
    background: #000000;
    color: #ffffff;
    border-color: #ffffff;
    transform: scale(1.02);
}

.record-button.recording {
    background: #3b82f6;
    border-color: #3b82f6;
    animation: pulse 2s ease-in-out infinite;
}

.record-button.recording:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(59, 130, 246, 0);
    }
}

.record-icon {
    font-size: 2.5em;
    margin-bottom: 8px;
}

.status-text {
    margin-top: 24px;
    font-size: 0.95em;
    color: #9ca3af;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.transcription-area,
.result-area {
    margin-top: 40px;
    padding: 0;
    background: transparent;
}

.transcription-area h3,
.result-area h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    font-weight: 600;
}

.loading-spinner {
    border: 2px solid #374151;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.live-transcript {
    text-align: left;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    min-height: 80px;
    max-height: 280px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #374151;
    border-radius: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    color: #e5e7eb;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-content {
    text-align: left;
    margin: 30px 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.result-section {
    margin-bottom: 30px;
}

.result-section h4 {
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-badge {
    display: inline-block;
    background: #3b82f6;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9em;
}

.note-content {
    background: transparent;
    padding: 0;
    border: none;
    border-left: 1px solid #3b82f6;
    padding-left: 20px;
    line-height: 1.7;
    white-space: pre-wrap;
    color: #ffffff;
}

/* Buttons */
.primary-button,
.secondary-button,
.danger-button {
    padding: 12px 28px;
    border: 1px solid #374151;
    border-radius: 4px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 5px;
    font-weight: 500;
}

.primary-button {
    background: #ffffff;
    color: #000000;
}

.primary-button:hover {
    background: #000000;
    color: #ffffff;
    border-color: #ffffff;
}

.secondary-button {
    background: transparent;
    color: #ffffff;
    border: 1px solid #374151;
}

.secondary-button:hover {
    border-color: #ffffff;
}

.danger-button {
    background: transparent;
    color: #dc2626;
    border-color: #dc2626;
}

.danger-button:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Divider */
.divider {
    height: 1px;
    background: #374151;
    margin: 60px 0;
}

/* Quick Access */
.quick-access {
    text-align: center;
    margin-top: 40px;
}

.manage-link {
    display: inline-block;
    padding: 14px 32px;
    background: #ffffff;
    color: #000000;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #374151;
}

.manage-link:hover {
    background: #000000;
    color: #ffffff;
    border-color: #ffffff;
}

/* Auth Section */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: 40px 20px;
}

.auth-box {
    background: transparent;
    padding: 40px;
    text-align: center;
    min-width: 400px;
    max-width: 500px;
}

.auth-box h2 {
    margin-bottom: 30px;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.8em;
}

.auth-box input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid #374151;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.2s;
    background: #000000;
    color: #ffffff;
}

.auth-box input:focus {
    outline: none;
    border-color: #3b82f6;
}

.error-message {
    color: #dc2626;
    margin-top: 12px;
    font-size: 0.9em;
}

/* Filter Section */
.filter-section {
    margin-bottom: 40px;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-controls label {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9em;
}

.filter-controls select {
    padding: 10px 14px;
    border: 1px solid #374151;
    border-radius: 4px;
    font-size: 0.95em;
    min-width: 200px;
    background: #000000;
    color: #ffffff;
    transition: border-color 0.2s;
}

.filter-controls select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Categories Section */
.categories-section {
    margin-bottom: 50px;
}

.categories-section h2 {
    color: #ffffff;
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 1.5em;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background: transparent;
    color: #ffffff;
    padding: 24px;
    border: 1px solid #374151;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.category-card h3 {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1.1em;
}

.category-card p {
    font-size: 0.9em;
    color: #9ca3af;
}

.category-card .note-count {
    margin-top: 12px;
    font-weight: 600;
    color: #3b82f6;
    font-size: 0.9em;
}

/* Notes Section */
.notes-section h2 {
    color: #ffffff;
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 1.5em;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.note-card {
    background: transparent;
    padding: 24px;
    border: 1px solid #374151;
    border-left: 1px solid #3b82f6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.note-card:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

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

.note-card .note-category {
    background: #3b82f6;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.note-card .note-date {
    font-size: 0.8em;
    color: #9ca3af;
}

.note-card .note-preview {
    color: #ffffff;
    line-height: 1.6;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.note-card .note-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #000000);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: #000000;
    margin: 5% auto;
    padding: 40px;
    border: 1px solid #374151;
    border-radius: 4px;
    width: 80%;
    max-width: 800px;
    position: relative;
}

.close {
    color: #9ca3af;
    float: right;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover,
.close:focus {
    color: #ffffff;
}

.modal-content h2 {
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 0;
    color: #ffffff;
}

.modal-actions {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #374151;
}

#noteDetail {
    margin: 20px 0;
}

#noteDetail .detail-section {
    margin-bottom: 24px;
}

#noteDetail .detail-section h3 {
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#noteDetail .detail-section p {
    line-height: 1.7;
    white-space: pre-wrap;
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2em;
    }

    .subtitle {
        font-size: 1em;
    }

    .main-content {
        padding: 20px 10px;
    }

    .record-button {
        width: 150px;
        height: 150px;
        font-size: 0.9em;
    }

    .record-icon {
        font-size: 2em;
    }

    .auth-box {
        min-width: auto;
        width: 100%;
        padding: 30px 20px;
    }

    .categories-grid,
    .notes-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 30px 20px;
    }

    .filter-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-controls select {
        width: 100%;
    }

    .filter-controls input[type="search"] {
        width: 100%;
    }
}

/* Search input */
.filter-controls input[type="search"] {
    padding: 10px 14px;
    border: 1px solid #374151;
    border-radius: 4px;
    font-size: 0.95em;
    min-width: 220px;
    background: #000000;
    color: #ffffff;
    transition: border-color 0.2s;
}

.filter-controls input[type="search"]:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Tag chips and note meta */
.note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
}

.tag-chip {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid #3b82f6;
    color: #93c5fd;
    border-radius: 999px;
    font-size: 0.78em;
}

.action-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #6ee7b7;
    border-radius: 999px;
    font-size: 0.78em;
}

.action-list {
    margin: 8px 0 0 20px;
    line-height: 1.7;
}

/* To-do overview section */
.todos-section {
    margin-bottom: 50px;
}

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

.todo-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #cbd5e1;
    cursor: pointer;
}

.todos-overview .todo-item {
    cursor: pointer;
    transition: background 0.15s;
    padding: 10px 12px;
    border-radius: 8px;
}

.todos-overview .todo-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* To-do list */
.todo-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.todo-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #1f2937;
}

.todo-task {
    font-weight: 500;
}

.due-badge,
.urgency-badge,
.cal-badge,
.urgent-badge {
    font-size: 0.75em;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.due-badge {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid #3b82f6;
    color: #93c5fd;
}

.cal-badge {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid #8b5cf6;
    color: #c4b5fd;
}

.urgency-badge {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.urgency-high {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid #f59e0b;
    color: #fcd34d;
}

.urgency-urgent {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.urgent-badge {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

/* Edit mode */
.edit-textarea {
    width: 100%;
    min-height: 220px;
    padding: 14px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #000000;
    color: #ffffff;
    font-size: 0.95em;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}

.edit-select {
    padding: 10px 14px;
    border: 1px solid #374151;
    border-radius: 4px;
    background: #000000;
    color: #ffffff;
    min-width: 220px;
}

.edit-textarea:focus,
.edit-select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: #00150c;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 2000;
}
