:root {
    --bg-color: #f8faff;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-pdf: #2563eb;
    --accent-image: #9333ea;
    --accent-bots: #f59e0b;
    --accent-converter: #ea580c;
    --glass-blur: 0px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #f8faff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 1 auto;
    /* Allow growth but don't force equal share */
    min-width: 0;
}

#back-btn {
    background: white;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

#back-btn:active {
    transform: scale(0.95);
    background: #f1f5f9;
}

#header-page-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

#header-page-info h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#header-page-info p {
    font-size: 11px;
    color: #64748b;
    margin: 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    /* Take up remaining space */
    min-width: 0;
    text-align: center;
}

/* Landing page specific layout */
.landing-header {
    justify-content: center;
    min-height: 100px;
}

.landing-header .header-content {
    align-items: center;
}

.landing-header .header-left,
.landing-header .header-right {
    display: none;
}

/* Hide logo specifically on non-home pages */
header:not(.landing-header) .logo-wrapper {
    display: none;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    flex: 0 0 auto;
    /* Fixed size based on icon */
}

.icon-btn {
    background: white;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #f1f5f9;
}

.icon-btn:active {
    transform: scale(0.95);
    background: #e2e8f0;
}

.search-input {
    width: 150px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-input.hidden {
    display: none;
}

#back-btn:hover {
    background: var(--card-bg);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0px;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    color: #4f46e5;
    letter-spacing: -1px;
    line-height: 1.1;
}

.header-subtext {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
}



.hidden {
    display: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
}

/* Main Content Area */
main {
    flex: 1;
    padding: 0 20px;
}

.home-intro {
    text-align: center;
    margin: 20px 0 32px;
}

.home-intro h2 {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 8px;
}

.home-intro p {
    font-size: 15px;
    color: #64748b;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.category-card:active {
    transform: scale(0.96);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.category-card .icon-box {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.category-card h2 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.accent-bar {
    width: 40px;
    height: 4px;
    border-radius: 2px;
}

/* Category Specifics */
.category-card.pdf .icon-box {
    background: #eff6ff;
    color: var(--accent-pdf);
}

.category-card.pdf .accent-bar {
    background: var(--accent-pdf);
}

.category-card.image .icon-box {
    background: #f5f3ff;
    color: var(--accent-image);
}

.category-card.image .accent-bar {
    background: var(--accent-image);
}


.category-card.converter .icon-box {
    background: #fff7ed;
    color: var(--accent-converter);
}

.category-card.converter .accent-bar {
    background: var(--accent-converter);
}

.category-card.bots .icon-box {
    background: #fffbeb;
    color: var(--accent-bots);
}

.category-card.bots .accent-bar {
    background: var(--accent-bots);
}

.category-card.coming-soon {
    opacity: 0.8;
    cursor: default;
}

.category-card.coming-soon:active {
    transform: none;
}

.badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: -8px;
}

/* Category View Layout */
.category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 24px;
}

.category-header-text h1 {
    font-size: 20px;
    color: #0f172a;
    text-align: left;
    margin: 0;
}

.category-header-text p {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.tool-list-horizontal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tool-card-horizontal {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-card-horizontal:active {
    transform: scale(0.98);
    background: #f8faff;
}

.tool-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.tool-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-card-info h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
}

.tool-card-info p {
    font-size: 13px;
    color: #64748b;
}

/* Tool Interface Styles */

.upload-area {
    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
}

.upload-area:hover {
    border-color: #4f46e5;
    background: #f8faff;
}

.upload-area:active {
    transform: scale(0.98);
}

.upload-area svg {
    margin-bottom: 12px;
    color: #64748b;
}

.upload-area p {
    color: #64748b;
    font-weight: 500;
}

.file-list {
    margin-bottom: 24px;
}

.file-item {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.action-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    background: #4f46e5;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
    transition: all 0.2s;
}

.action-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.action-btn:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}

.status-msg {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

/* Bottom Nav */

/* Writing Tools */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideIn 0.4s ease-out forwards;
}