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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    overflow-x: hidden;
    height: 100vh;
}

/* Auth Screen */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 10px;
}

.tagline {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.auth-box input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
}

.auth-box input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-box button {
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-link {
    background: transparent;
    color: #667eea;
}

.btn-link:hover {
    text-decoration: underline;
}

/* App Header */
.app-header {
    background: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.8em;
    color: #333;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#userDisplay {
    color: #666;
    font-weight: 500;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

/* Mode Tabs */
.mode-tabs {
    background: white;
    padding: 10px;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    flex: 1;
    padding: 12px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab.active {
    background: #667eea;
    color: white;
}

/* Content Area */
.mode-content {
    background: white;
    padding: 20px;
    min-height: calc(100vh - 250px);
}

.input-title {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
}

.input-title:focus {
    outline: none;
    border-color: #667eea;
}

.input-content {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
}

.input-content:focus {
    outline: none;
    border-color: #667eea;
}

/* Stylus Mode */
.stylus-toolbar {
    margin-bottom: 15px;
}

.tool-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tool {
    min-width: 44px;
    height: 44px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tool.eraser {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.tool.eraser.active {
    background: #c92a2a;
}

#canvas {
    width: 100%;
    height: calc(100vh - 400px);
    min-height: 300px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    touch-action: none;
    cursor: crosshair;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-bar button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* Notes Section */
.notes-section {
    background: white;
    padding: 20px;
    margin-top: 20px;
}

.notes-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#notesList {
    display: grid;
    gap: 15px;
}

.note-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    position: relative;
}

.note-card h4 {
    margin-bottom: 8px;
    color: #333;
}

.note-card p {
    color: #666;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.note-type {
    display: inline-block;
    padding: 4px 10px;
    background: #667eea;
    color: white;
    border-radius: 5px;
    font-size: 12px;
    margin-bottom: 8px;
}

.note-type.stylus {
    background: #ff6b6b;
}

.note-image {
    width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 10px;
}

.note-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

.note-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
}

@media (max-width: 768px) {
    .mode-content {
        padding: 15px;
    }

    .tool-row {
        justify-content: flex-start;
    }

    #canvas {
        height: calc(100vh - 450px);
    }
}
