/**
 * Home Page Styles
 * Product Module Showcase
 * v3.0.0: Redesigned for module-based licensing
 */

/* Container */
.home-container {
    padding: 0 24px 48px;
}

/* Hero Section */
.home-hero {
    text-align: center;
    padding: 40px 24px 32px;
    margin-bottom: 24px;
}

.home-hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.home-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    border-radius: 18px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.home-logo svg {
    color: white;
}

.home-hero h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.home-tier-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: var(--accent-primary-bg);
    padding: 4px 12px;
    border-radius: 12px;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.home-org-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
    min-height: 1.25em;
}

.home-org-name:empty {
    display: none;
}

.home-tagline {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}

/* Section Headers */
.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.home-section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.home-module-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 12px;
}

.home-section-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Modules Section */
.home-modules {
    margin-bottom: 32px;
}

.home-modules--available {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.home-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding-top: 12px;
    padding-right: 12px;
}

/* Module Cards */
.home-module-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible;
}

/* Licensed Module Card */
.home-module-card--licensed {
    cursor: pointer;
    border-left: 4px solid var(--module-color);
}

.home-module-card--licensed:hover {
    border-color: var(--module-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.home-module-card--licensed .module-icon {
    background: var(--module-bg);
    color: var(--module-color);
}

.home-module-card--licensed .module-badge--active {
    background: var(--tint-success);
    color: var(--color-success);
}

.home-module-card--licensed .module-action {
    color: var(--module-color);
}

/* Locked Module Card */
.home-module-card--locked {
    background: var(--bg-secondary);
    border-style: dashed;
}

.home-module-card--locked .module-icon--locked {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.home-module-card--locked .module-content h3 {
    color: var(--text-muted);
}

.home-module-card--locked .module-tagline {
    color: var(--text-muted);
}

.home-module-card--locked .module-description {
    color: var(--text-muted);
}

.home-module-card--locked .module-feature-tag {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Module Header */
.module-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.module-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

.module-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
}

.module-badge--locked {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.module-badge--included {
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
}

.module-badge--admin {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

/* Coming Soon badge - positioned like discount badge in purchase modal */
.module-badge--coming-soon {
    position: absolute;
    top: -10px;
    right: -10px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    z-index: 1;
}

/* Early Access badge - blue/info gradient to differentiate from amber Coming Soon */
.module-badge--early-access {
    position: absolute;
    top: -10px;
    right: -10px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
    z-index: 1;
}


/* Module Content */
.module-content {
    flex: 1;
    margin-bottom: 16px;
}

.module-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.module-tagline {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--module-color);
    margin: 0 0 8px 0;
}

.module-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Module Features */
.module-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.module-feature-tag {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 6px;
}

.home-module-card--licensed .module-feature-tag {
    background: var(--module-bg);
    color: var(--module-color);
}

/* Module Actions */
.module-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.module-launch {
    display: flex;
    align-items: center;
    gap: 6px;
}

.module-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    color: var(--text-on-accent);
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.module-upgrade-btn:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

/* Quick Actions Section */
.home-quick-actions {
    margin-bottom: 32px;
}

.home-quick-actions h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.home-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.home-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.home-action-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.home-action-btn svg {
    color: var(--text-muted);
}

.home-action-btn:hover svg {
    color: var(--accent-primary);
}

.home-action-btn span {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Quick Actions Empty State */
.home-quick-actions-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    text-align: center;
}

.home-quick-actions-empty p {
    margin: 0 0 16px 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.home-quick-actions-empty .home-action-btn {
    padding: 12px 24px;
    flex-direction: row;
    gap: 8px;
}

/* Getting Started Card */
.home-getting-started {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 8px;
}

.home-getting-started:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.08);
}

.home-gs-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--accent-primary-bg, rgba(59, 130, 246, 0.1));
    color: var(--accent-primary);
    flex-shrink: 0;
}

.home-gs-content {
    flex: 1;
    min-width: 0;
}

.home-gs-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.home-gs-content p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.home-gs-arrow {
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.home-getting-started:hover .home-gs-arrow {
    color: var(--accent-primary);
    transform: translateX(3px);
}

/* Help Section */
.home-help {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
}

.home-help-content {
    max-width: 500px;
    margin: 0 auto;
}

.home-help h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.home-help p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 24px 0;
}

.home-help-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.help-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.help-link svg {
    color: inherit;
}

/* Responsive */
@media (max-width: 1200px) {
    .home-modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .home-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .home-container {
        padding: 0 16px 32px;
    }

    .home-hero {
        padding: 32px 16px 24px;
    }

    .home-hero h1 {
        font-size: 1.5rem;
    }

    .home-modules-grid {
        grid-template-columns: 1fr;
    }

    .home-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .home-unassigned-notice {
        padding: 14px 16px;
    }

    .home-getting-started {
        padding: 16px 20px;
        gap: 14px;
    }

    .home-gs-icon {
        width: 44px;
        height: 44px;
    }

    .home-gs-icon svg {
        width: 24px;
        height: 24px;
    }

    .home-help-actions {
        flex-direction: column;
    }

    .help-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .home-actions-grid {
        grid-template-columns: 1fr;
    }

    .module-features {
        display: none;
    }
}

/* Unassigned User Notice Banner */
.home-unassigned-notice {
    margin: 0 0 24px;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--color-warning, #d97706);
    border-left: 4px solid var(--color-warning, #d97706);
    border-radius: 8px;
}

.home-unassigned-notice .unassigned-notice-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.home-unassigned-notice .unassigned-icon {
    flex-shrink: 0;
    color: var(--color-warning, #d97706);
    margin-top: 2px;
}

.home-unassigned-notice .unassigned-notice-text {
    flex: 1;
    min-width: 0;
}

.home-unassigned-notice .unassigned-notice-text strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.home-unassigned-notice .unassigned-notice-text p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.home-unassigned-notice .unassigned-notice-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.home-unassigned-notice .unassigned-notice-close:hover {
    color: var(--text-primary);
}

.home-unassigned-notice .unassigned-notice-persist {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
}

.home-unassigned-notice .unassigned-notice-persist input {
    margin: 0;
    cursor: pointer;
}

/* Dark mode is handled automatically via CSS variables from base.css */
