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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
}

[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 25px;
    box-shadow: var(--shadow-xl);
    position: relative;
}

[data-theme="dark"] .header-content {
    background: rgba(26, 32, 44, 0.95);
}

.title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.title i {
    color: var(--primary-color);
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 15px;
}

.header-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Search Bar */
.search-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

[data-theme="dark"] .search-bar {
    background: rgba(26, 32, 44, 0.95);
}

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

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.search-container input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
}

.search-result {
    padding: 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result:hover {
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.search-result-tab {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

.search-result-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 25px;
    flex: 1;
}

/* Tabs */
.tabs-section {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

[data-theme="dark"] .tabs-section {
    background: rgba(26, 32, 44, 0.95);
}

.tabs-header {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.tab-btn:hover::before {
    left: 100%;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.tab-btn i {
    font-size: 1rem;
}

/* Editor Section */
.editor-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 25px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

[data-theme="dark"] .editor-section {
    background: rgba(26, 32, 44, 0.95);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.editor-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.format-btn {
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.format-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.format-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Tab Content */
.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex-direction: column;
    flex: 1;
}

.tab-pane.active {
    display: flex;
}

.note-textarea {
    flex: 1;
    min-height: 300px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

.note-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: var(--bg-primary);
}

/* Tasks Section */
.tasks-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

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

.tasks-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tasks-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.task-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
}

.task-item.completed {
    opacity: 0.7;
    text-decoration: line-through;
}

.task-item.urgent {
    border-left: 4px solid var(--danger-color);
}

.task-item.important {
    border-left: 4px solid var(--warning-color);
}

.task-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.task-checkbox.checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.task-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.task-text {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.task-due-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.task-actions {
    display: flex;
    gap: 5px;
}

.task-delete {
    padding: 4px 8px;
    border: none;
    background: var(--danger-color);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.2s ease;
}

.task-item:hover .task-delete {
    opacity: 1;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 10px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.share-section,
.calculator-section,
.timer-section,
.stats-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .share-section,
[data-theme="dark"] .calculator-section,
[data-theme="dark"] .timer-section,
[data-theme="dark"] .stats-section {
    background: rgba(26, 32, 44, 0.95);
}

.share-header,
.calculator-header,
.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.share-header h2,
.calculator-header h3,
.timer-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.share-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    width: 100%;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 8px 12px;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.btn-icon {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 10px;
    min-width: 40px;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

/* Voice Recording */
.btn-secondary.recording {
    background: var(--danger-color);
    color: white;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Link Container */
.link-container {
    margin-top: 20px;
    animation: slideIn 0.3s ease;
}

.link-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.link-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.link-input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.link-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.link-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 10px 12px;
    border-radius: var(--radius-md);
}

.link-info i {
    color: var(--primary-color);
}

/* Timer */
.timer {
    text-align: center;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.timer-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.timer-presets {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Calculator */
.calculator {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#calculatorDisplay {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    text-align: right;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-btn {
    padding: 15px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.calc-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.calc-operation {
    background: var(--primary-color);
    color: white;
}

.calc-equals {
    background: var(--accent-color);
    color: white;
    grid-row: span 2;
}

.calc-clear {
    background: var(--danger-color);
    color: white;
}

.calc-zero {
    grid-column: span 2;
}

.split-calculator {
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.split-calculator h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.split-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.split-inputs input {
    flex: 1;
    min-width: 80px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.split-result {
    padding: 10px;
    background: var(--accent-color);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    min-height: 20px;
}

.quick-calculations {
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.quick-calculations h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.quick-calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-calc-btn {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.quick-calc-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Statistics */
.stats-section h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.footer-shortcuts {
    margin-top: 10px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

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

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

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#taskInput {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#taskInput:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.task-options {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.task-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#taskDueDate {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Templates */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.template-card {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.template-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.template-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.template-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.template-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Export */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.export-btn {
    padding: 15px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.export-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.export-btn i {
    font-size: 1.5rem;
}

.export-settings {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.export-settings label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1001;
    font-weight: 500;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: var(--danger-color);
}

.notification.warning {
    background: var(--warning-color);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .header-content,
    .editor-section,
    .share-section,
    .calculator-section,
    .timer-section,
    .stats-section {
        padding: 20px;
    }
    
    .tabs-header {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .tab-btn {
        flex-shrink: 0;
        padding: 10px 16px;
    }
    
    .tab-btn span {
        display: none;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .editor-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .note-textarea {
        min-height: 250px;
    }
    
    .editor-footer {
        flex-direction: column;
        gap: 5px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .calculator-buttons {
        gap: 5px;
    }
    
    .calc-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .split-inputs {
        flex-direction: column;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .export-options {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .header-actions {
        gap: 5px;
    }
    
    .btn-icon {
        padding: 8px;
        min-width: 36px;
    }
    
    .editor-actions {
        gap: 5px;
    }
    
    .timer-display {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
        max-width: none;
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .header-actions,
    .editor-actions,
    .sidebar,
    .footer {
        display: none;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .editor-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .note-textarea {
        border: none;
        background: transparent;
        resize: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-muted: #333333;
    }
}

/* Focus styles for accessibility */
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

