/* Notes Web Interface Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.header-search-form {
    position: relative;
    display: flex;
}

.header-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    background: rgba(255,255,255,0.9);
    color: #333;
    outline: none;
    transition: background-color 0.2s;
}

.header-search-input:focus {
    background: white;
}

.header-search-input::placeholder {
    color: #666;
}

.header-search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.header-search-btn:hover {
    background: #2980b9;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header h1 {
    display: inline-block;
    margin-right: 2rem;
}

header nav {
    display: inline-block;
}

header nav a {
    color: white;
    text-decoration: none;
    margin-right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

header nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

.user-info {
    color: rgba(255,255,255,0.8);
    margin-right: 1rem;
    font-size: 0.9rem;
}

.logout-btn {
    background: rgba(231,76,60,0.8);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background: rgba(231,76,60,1);
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.category-card h2 {
    margin-bottom: 1rem;
}

.category-card h2 a {
    color: #2c3e50;
    text-decoration: none;
}

.stats {
    color: #666;
}

.stat {
    margin-bottom: 0.5rem;
}

.count {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
    display: block;
}

.label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.breakdown span {
    margin-right: 1rem;
}

/* Category and File Lists */
.category-info {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.files-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.file-item {
    border-bottom: 1px solid #eee;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

.file-item a:hover {
    background-color: #f8f9fa;
}

.file-name {
    font-weight: 500;
    flex: 1;
}

.file-type {
    background: #e9ecef;
    color: #666;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-item.fragment .file-type {
    background: #fff3cd;
    color: #856404;
}

.file-item.complete .file-type {
    background: #d4edda;
    color: #155724;
}

/* Note Display */
.note-meta {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.note-meta .category,
.note-meta .type {
    background: #e9ecef;
    color: #666;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    line-height: 1.8;
}

.note-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.note-content h1, .note-content h2, .note-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.note-content h1:first-child,
.note-content h2:first-child,
.note-content h3:first-child {
    margin-top: 0;
}

.note-content p {
    margin-bottom: 1rem;
}

.note-content ul, .note-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.note-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #666;
    font-style: italic;
}

.note-content code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.9rem;
}

.note-content pre code {
    background: none;
    padding: 0;
}

/* Search */
.search-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
}

.search-button {
    padding: 0.75rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-button:hover {
    background: #2980b9;
}

.search-results h2 {
    margin-bottom: 1.5rem;
    color: #666;
}

.search-result {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-result h3 {
    margin-bottom: 0.5rem;
}

.search-result h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.search-result h3 a:hover {
    text-decoration: underline;
}

.result-meta {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
}

.result-meta .category,
.result-meta .type {
    background: #e9ecef;
    color: #666;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.preview {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.search-result-score {
    background: #3498db;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

.filename-match {
    background: #e74c3c;
}

.content-match {
    background: #27ae60;
}

.mixed-match {
    background: #f39c12;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 0.5rem 1rem;
    }
    
    .header-top {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .header-search {
        order: 2;
        margin: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .header-user-info {
        order: 3;
        justify-content: center;
        font-size: 0.9rem;
        gap: 0.5rem;
    }
    
    .user-info {
        font-size: 0.8rem;
    }
    
    .logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    header h1 {
        order: 1;
        margin: 0;
        font-size: 1.2rem;
        text-align: center;
    }
    
    header nav {
        display: flex;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    header nav a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    main {
        margin: 1rem auto;
        padding: 0 1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .note-content {
        padding: 1rem;
    }
    
    /* Ensure no horizontal overflow */
    body {
        overflow-x: hidden;
    }
    
    .header-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}