/* PM7 UI - Custom styles for texty.to */

/* Use PM7 CSS variables and extend them */
:root {
    /* PM7 variables are already defined, we just add custom ones */
    --header-height: 56px;
    --content-max-width: 720px;
}

/* Clean body without gradients */
body {
    background: var(--pm7-background);
    color: var(--pm7-foreground);
    font-family: var(--pm7-font-sans);
    line-height: 1.6;
    margin: 0;
}

/* Clean header */
.app-header {
    background: var(--pm7-card);
    border-bottom: 1px solid var(--pm7-border);
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.logo h1 {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
}

.tagline {
    font-size: 0.875rem;
    color: var(--pm7-muted-foreground);
}

/* Main content */
.main-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Icon buttons in card header */
.card-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-button {
    background: none;
    border: none;
    padding: 0.375rem;
    cursor: pointer;
    color: var(--pm7-muted-foreground);
    opacity: 0.5;
    border-radius: var(--pm7-radius);
    transition: all 0.2s ease;
}

.icon-button:hover {
    color: var(--pm7-foreground);
    opacity: 1;
    background: var(--pm7-muted);
}

.icon-button svg {
    display: block;
}

/* Metadata footer */
.metadata-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin: 1.5rem 0;
    font-size: 0.8125rem;
    color: var(--pm7-muted-foreground);
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--pm7-muted-foreground);
}

.metadata-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.metadata-separator {
    display: inline-block;
    margin: 0 0.25rem;
}

/* Text content container */
.text-container {
    margin-bottom: 0;
    margin-top: 2rem;
}

/* Fix card header layout */
.text-container .pm7-card-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.text-container .pm7-card-title {
    margin: 0;
    text-align: left;
}

.text-display {
    padding: 2rem;
    font-family: var(--pm7-font-mono);
    font-size: 0.9375rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 60vh;
    overflow-y: auto;
    margin: 0;
    background: transparent;
    border: none;
}

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

.text-display::-webkit-scrollbar-track {
    background: transparent;
}

.text-display::-webkit-scrollbar-thumb {
    background: var(--pm7-border);
    border-radius: 4px;
}

.text-display::-webkit-scrollbar-thumb:hover {
    background: var(--pm7-muted-foreground);
}

/* Actions */
.actions {
    display: flex;
    gap: 0.5rem;
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

/* Error state */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-cat {
    margin-bottom: 1.5rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.error-message {
    color: var(--pm7-muted-foreground);
    margin: 0 0 1.5rem;
}

/* Footer */
.text-footer {
    text-align: center;
    padding: 2rem 0;
    font-size: 0.8125rem;
    color: var(--pm7-muted-foreground);
}

/* Home page */
.hero {
    padding: 4rem 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 1rem;
    text-align: center;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--pm7-muted-foreground);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.feature {
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section {
    text-align: center;
    margin: 4rem 0;
}

/* Browse page */
.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    .tagline {
        display: none;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .text-title {
        font-size: 1.5rem;
    }
    
    .metadata {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .text-display {
        padding: 1.5rem;
        font-size: 0.875rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
}