:root {
    --primary: #5ddbcb;
    --primary-gradient: linear-gradient(135deg, #7cff9b 0%, #5ddbc7 100%);
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --background: #FFFFFF;
    --surface: #f8f9fa;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 400;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.4;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 15px 10px 0;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    font-size: 14px;
}

.app-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
}

.main-content {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    width: 100%;
    transform: scale(0.9);
    transform-origin: top center;
}

.hero-title {
    font-size: 36px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.hero-subtitle {
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.search-container {
    margin: 25px auto 16px;
    width: 100%;
}

.search-box {
    background: white;
    border-radius: 10px;
    padding: 15px 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid #e5e5e5;
    width: 100%;
    box-sizing: border-box;
}

.search-input {
    width: 100%;
    padding: 8px 0;
    border: none;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    margin-bottom: 12px;
}

.search-input::placeholder {
    color: #333;
    opacity: 1;
}

.search-input:focus {
    outline: none;
}

.search-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.left-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.integration-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 65px;
    position: relative;
    cursor: pointer;
}

.integration-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: flex;
}

.github-icon {
    width: 18px;
    height: 18px;
}

.google-icon {
    color: #4285F4;
}

.integration-count {
    color: #888;
    font-size: 12px;
    font-weight: 500;
    margin-left: 2px;
    display: flex;
    align-items: center;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    min-width: 55px;
    position: relative;
    justify-content: center;
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    position: relative;
    width: 34px;
    height: 18px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ddd;
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: #5F5EF1;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    text-align: center;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mic-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #8E8EA0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    height: 32px;
}

.mic-btn:hover {
    color: #666;
}

.mic-btn svg {
    width: 20px;
    height: 20px;
}

.send-btn {
    background: #5F5EF1;
    color: white;
    border: none;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.send-btn:hover {
    background: #4f4edb;
}

.send-btn svg {
    width: 16px;
    height: 16px;
}

.category-nav {
    display: flex;
    gap: 6px;
    margin: 0 auto 12px;
    justify-content: center;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 600px;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    text-align: center;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.category-nav:after {
    content: '';
    flex: 0 0 5px;
}

.category-nav:before {
    content: '';
    flex: 0 0 5px;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-align: center;
    min-width: fit-content;
    flex: 0 0 auto;
    margin-bottom: 0;
}

.category-btn:hover {
    border-color: #ccc;
    color: #333;
}

.category-btn.active {
    background: black;
    color: #fff;
    border-color: black;
}

.suggested-tasks {
    margin-top: 1.5rem;
    padding: 0 1rem;
}

.suggested-tasks h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.8rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.task-card {
    background: #EEEEEE;
    border-radius: var(--border-radius);
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 40px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    box-shadow: 0 0 10px rgba(45, 212, 163, 0.3);
    background: #E5E5E5;
    transform: translateY(-2px);
}

.task-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(45, 212, 163, 0.08), rgba(45, 212, 163, 0.06));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.task-card:hover::before {
    opacity: 1;
}

.task-card h3 {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    position: relative;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-card h3::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url('images/village-logo.png') no-repeat center center;
    background-size: contain;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Remove the data-length specific styles */
.task-card h3[data-length="long"] {
    font-size: 0.875rem;
}

/* Touch active state for task cards */
.task-card.touch-active {
    transform: scale(0.98);
    box-shadow: 0 0 8px rgba(45, 212, 163, 0.3);
    background: linear-gradient(to right, #f2f1f4, #f7f6f9);
}

.task-card.touch-active::before {
    opacity: 1;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .search-box {
        padding: 16px;
    }
    
    .category-nav {
        margin-top: 15px;
        gap: 5px;
        overflow-x: auto;
        justify-content: center;
        padding: 0;
        flex-wrap: nowrap;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .category-nav:after {
        content: '';
        flex: 0 0 5px;
    }
    
    .category-nav:before {
        content: '';
        flex: 0 0 5px;
    }
    
    .category-btn {
        padding: 3px 5px;
        font-size: 9px;
        white-space: nowrap;
        flex-grow: 0;
        flex-shrink: 0;
        margin: 0 1px;
    }
    
    .left-controls {
        gap: 10px;
        flex-shrink: 0;
        width: auto;
        min-width: 170px;
    }
    
    .search-controls {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 12px;
    }
    
    .action-buttons {
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .task-list {
        gap: 0.625rem;
        padding: 0 1rem;
    }
    
    .task-card {
        height: 44px;
    }
    
    .task-card h3 {
        font-size: 0.875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100% - 20px);
    }
    
    .task-card h3[data-length="long"] {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0 5px;
    }
    
    .search-box {
        padding: 12px;
        border-width: 2px;
    }
    
    .search-input {
        font-size: 14px;
        padding: 10px 0;
        margin-bottom: 12px;
    }
    
    .task-list {
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    
    .task-card {
        height: 40px;
        padding: 0.875rem;
    }
    
    .task-card h3 {
        font-size: 13px;
    }
    
    .task-card h3[data-length="long"] {
        font-size: 13px;
    }
    
    .integration-icons {
        gap: 4px;
    }
    
    .integration-icon {
        width: 16px;
        height: 16px;
    }
    
    .toggle-container {
        gap: 4px;
    }
    
    .suggested-tasks h2 {
        font-size: 14px;
        margin-bottom: 6px;
        padding-left: 0.5rem;
    }
    
    .left-controls {
        min-width: 150px;
        flex-shrink: 0;
    }
    
    .search-controls {
        flex-direction: row;
        align-items: center;
    }
    
    .action-buttons {
        flex-shrink: 0;
    }
    
    .task-card h3::before {
        width: 14px;
        height: 14px;
        margin-right: 8px;
    }
    
    .category-nav {
        padding: 0;
        max-width: 100%;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .category-btn {
        padding: 4px 6px;
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .suggested-tasks {
        padding: 0 1rem;
        margin-top: 1.5rem;
    }
    
    .om1-popup {
        width: 260px;
        left: 50%;
    }
    
    .om1-popup:after {
        left: 50%;
        margin-left: -6px;
    }
    
    .om1-popup-header h3 {
        font-size: 13px;
    }
    
    .om1-popup-body {
        padding: 6px 8px 8px;
    }
    
    .om1-popup-body p,
    .om1-popup-body li {
        font-size: 11px;
    }
    
    .om1-popup-header {
        padding: 6px 8px;
    }
    
    .integrations-popup {
        width: 280px;
        left: 50%;
    }
    
    .integrations-popup:after {
        margin-left: -70px;
    }
    
    .integration-item {
        height: 50px;
    }
    
    .integration-logo {
        max-height: 30px;
    }
}

@media (max-width: 360px) {
    .search-controls {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .left-controls {
        width: auto;
        min-width: unset;
        flex-shrink: 0;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    
    .action-buttons {
        margin-left: auto;
        width: auto;
        justify-content: flex-end;
        flex-shrink: 0;
    }
    
    .search-input {
        font-size: 13px;
    }
    
    .search-box {
        padding: 10px;
    }
    
    .task-list {
        gap: 0.4rem;
    }
    
    .task-card {
        padding: 0.75rem;
        height: 38px;
    }
    
    .toggle-switch {
        width: 36px;
        height: 20px;
    }
    
    .toggle-slider:before {
        width: 14px;
        height: 14px;
        top: 3px;
        left: 3px;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(16px);
    }
    
    .toggle-label {
        font-size: 12px;
    }
    
    .integration-count {
        font-size: 12px;
    }
    
    .category-nav {
        padding: 2px 8px;
        max-width: calc(100% - 16px);
    }
    
    .mic-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .send-btn {
        width: 32px;
        height: 32px;
    }
    
    .om1-popup {
        width: 240px;
        left: 50%;
    }
    
    .om1-popup-header {
        padding: 8px 10px;
    }
    
    .om1-popup-body {
        padding: 8px;
    }
    
    .integrations-popup {
        width: 240px;
        left: 50%;
    }
    
    .integrations-popup:after {
        margin-left: -60px;
    }
    
    .integrations-grid {
        gap: 8px;
    }
    
    .integration-item {
        padding: 6px;
        height: 45px;
    }
}

/* New ultra-small screen size */
@media (max-width: 320px) {
    .search-box {
        padding: 8px;
    }
    
    .search-input {
        font-size: 12px;
        padding: 8px 0;
        margin-bottom: 10px;
    }
    
    .category-btn {
        padding: 3px 5px;
        font-size: 10px;
    }
    
    .task-card h3 {
        font-size: 12px;
    }
    
    .task-card h3::before {
        width: 12px;
        height: 12px;
        margin-right: 6px;
    }
    
    .suggested-tasks h2 {
        font-size: 13px;
    }
    
    .toggle-container, .integration-icons {
        min-width: auto;
    }
    
    .left-controls {
        gap: 6px;
    }
    
    .app-container {
        padding: 0 3px;
    }
}

/* Touch-specific styles for mobile devices */
@media (hover: none) and (pointer: coarse) {
    .task-card {
        -webkit-touch-callout: none;
        touch-action: manipulation;
    }
    
    .task-card:active {
        transform: scale(0.98);
        box-shadow: 0 0 8px rgba(45, 212, 163, 0.3);
        background: linear-gradient(to right, #f2f1f4, #f7f6f9);
    }
    
    .task-card:active::before {
        opacity: 1;
    }
    
    .category-btn {
        touch-action: manipulation;
    }
    
    .category-btn:active {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .category-btn.active:active {
        background: #333;
    }
    
    .send-btn:active {
        transform: scale(0.95);
    }
    
    .mic-btn:active {
        opacity: 0.7;
    }
    
    /* Make the horizontal scroll of categories smoother */
    .category-nav {
        scroll-snap-type: none;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .category-btn {
        scroll-snap-align: none;
        margin-bottom: 6px;
    }
}

/* OM1 Popup Styles */
.om1-popup {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    width: 260px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    border: 1px solid #eaeaea;
    pointer-events: none;
}

.om1-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.om1-popup:after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    margin-left: -6px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    border-left: 1px solid #eaeaea;
    border-top: 1px solid #eaeaea;
}

.om1-popup-content {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.om1-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.om1-popup-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.close-popup {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-popup:hover {
    background-color: #f5f5f5;
    color: #333;
}

.close-popup svg {
    width: 10px;
    height: 10px;
}

.om1-popup-body {
    padding: 8px 10px 10px;
    max-height: none;
    overflow-y: visible;
}

.om1-popup-body p {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.3;
    color: #333;
}

.om1-popup-body p:last-child {
    margin-bottom: 0;
}

.om1-popup-body ul {
    padding-left: 14px;
    margin: 4px 0 6px;
}

.om1-popup-body li {
    margin-bottom: 3px;
    font-size: 11px;
    line-height: 1.3;
    color: #333;
}

.om1-popup-body li:last-child {
    margin-bottom: 0;
}

/* Integrations popup specific styles */
.integrations-popup {
    width: 280px;
    left: 40%;
    transform: translateX(-50%) translateY(-5px);
    position: fixed;
    top: 50%;
    margin-top: -120px;
    z-index: 1000;
}

.integrations-popup.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.integrations-popup:after {
    left: 50%;
    margin-left: -80px;
}

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.integration-item {
    background-color: #f8f8f8;
    border-radius: 6px;
    padding: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
}

.integration-logo {
    max-width: 100%;
    max-height: 35px;
    object-fit: contain;
}

/* Specific logo size adjustments */
.integration-logo[alt="Slack"] {
    max-height: 42px;
}

.integration-logo[alt="Notion"] {
    max-height: 42px;
}

.integration-logo[alt="GitLab"] {
    max-height: 42px;
}

.integration-logo[alt="Jira"] {
    max-height: 28px;
}