/* === HOME PAGE — Redacio Modern Design === */

/* Body override for home */
.home-body {
    background: #f8f9fb;
    padding-bottom: 72px;
}

/* === TOP BAR === */
.home-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.home-brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: #007A3D;
    letter-spacing: -0.5px;
}

.home-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.home-icon-btn {
    position: relative;
    background: none;
    border: none;
    color: #555;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.home-icon-btn:hover {
    background: #f0f0f0;
}

.home-lang-btn {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.home-lang-btn:hover {
    background: #e4e4e4;
}

/* === LAYOUT === */
.home-main {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

/* === SEARCH (above hero) === */
.home-search-wrap {
    position: relative;
    margin: 16px 0 14px;
    border-radius: 28px;
    padding: 2px;
    background: linear-gradient(135deg, #007A3D, #34C76A, #00A651, #007A3D);
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 16px rgba(0, 122, 61, 0.12);
    transition: box-shadow 0.3s;
}

.home-search-wrap:focus-within {
    box-shadow: 0 4px 24px rgba(0, 122, 61, 0.22);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.home-search-inner {
    display: flex;
    align-items: center;
    width: 100%;
    background: #fff;
    border-radius: 26px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #007A3D;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.home-search-wrap:focus-within .search-icon {
    opacity: 1;
}

.search-filter-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #007A3D, #00A651);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 122, 61, 0.25);
}

.search-filter-btn:hover {
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 122, 61, 0.35);
}

/* Remove old flat filter icon */
.search-filter-icon {
    display: none;
}

/* === HERO BANNER === */
.home-hero {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 18px;
    min-height: 220px;
    background:
        linear-gradient(135deg, rgba(0,77,37,0.88) 0%, rgba(0,122,61,0.82) 40%, rgba(0,166,81,0.78) 70%, rgba(52,199,106,0.75) 100%),
        url('../assets/hero-bg.jpg') center/cover no-repeat;
}

/* Decorative light pattern (over image+gradient) */
.hero-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image:
        radial-gradient(circle at 15% 85%, rgba(255,255,255,0.6) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(255,255,255,0.5) 0%, transparent 35%),
        radial-gradient(circle at 55% 50%, rgba(255,255,255,0.3) 0%, transparent 40%);
}

/* Large decorative circles */
.home-hero::before {
    content: '';
    position: absolute;
    top: -70px;
    right: -50px;
    width: 240px;
    height: 240px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.home-hero::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

/* Content wrapper */
.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 36px 28px;
    gap: 16px;
}

.hero-text {
    flex: 1;
    color: #fff;
}

.hero-greeting {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.hero-tagline {
    font-size: 0.85rem;
    opacity: 0.92;
    line-height: 1.6;
    max-width: 300px;
    margin-bottom: 20px;
}

/* CTA button */
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: #fff;
    color: #007A3D;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    background: #f0fff5;
}

.hero-cta svg {
    transition: transform 0.2s;
}

.hero-cta:hover svg {
    transform: translateX(3px);
}

/* Dom avatar */
.hero-avatar {
    flex-shrink: 0;
    position: relative;
}

.dom-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.35);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    animation: avatarFloat 4s ease-in-out infinite;
}

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.home-search {
    width: 100%;
    padding: 15px 52px 15px 48px;
    border: none;
    border-radius: 26px;
    font-size: 0.92rem;
    font-family: inherit;
    background: transparent;
    color: #333;
}

.home-search::placeholder {
    color: #b0b0b0;
    font-weight: 400;
    letter-spacing: 0.2px;
}

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

/* === CATEGORY PILLS === */
.home-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 14px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.home-pills::-webkit-scrollbar {
    display: none;
}

.pill {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #666;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.pill:hover {
    border-color: #007A3D;
    color: #007A3D;
}

.pill.active {
    background: #007A3D;
    border-color: #007A3D;
    color: #fff;
}

/* === SECTIONS === */
.home-section {
    margin-bottom: 20px;
}

.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.home-section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #222;
}

/* === RECENT DOCUMENTS (horizontal scroll) === */
.recent-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.recent-scroll::-webkit-scrollbar {
    display: none;
}

.recent-card {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 18px;
    background: #fff;
    border: 1.5px solid #eee;
    border-radius: 14px;
    min-width: 110px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.recent-card:hover {
    border-color: #007A3D;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 122, 61, 0.1);
}

.recent-icon {
    font-size: 1.6rem;
}

.recent-name {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    color: #333;
}

.recent-date {
    font-size: 0.65rem;
    color: #aaa;
}

/* === DOCUMENT GRID === */
.home-doc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.home-doc-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 20px 12px 16px;
    background: #fff;
    border: 1.5px solid #f0f0f0;
    border-radius: 18px;
    text-decoration: none;
    color: #333;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardIn 0.4s ease both;
    position: relative;
    overflow: hidden;
}

.home-doc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 18px 18px 0 0;
    opacity: 0;
    transition: opacity 0.25s;
}

.home-doc-card:hover::before {
    opacity: 1;
}

.home-doc-card:hover {
    border-color: transparent;
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.home-doc-card:active {
    transform: translateY(-2px) scale(0.98);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icon circle */
.hdc-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 16px;
    flex-shrink: 0;
    transition: transform 0.25s;
}

.home-doc-card:hover .hdc-icon {
    transform: scale(1.08);
}

/* Category-based icon colors */
.home-doc-card[data-cat="courrier"] .hdc-icon {
    background: #e8f5ec;
}
.home-doc-card[data-cat="courrier"]::before {
    background: linear-gradient(90deg, #007A3D, #34C76A);
}

.home-doc-card[data-cat="comptabilite"] .hdc-icon {
    background: #e8f0fe;
}
.home-doc-card[data-cat="comptabilite"]::before {
    background: linear-gradient(90deg, #1a73e8, #669df6);
}

.home-doc-card[data-cat="decisions"] .hdc-icon {
    background: #fef3e0;
}
.home-doc-card[data-cat="decisions"]::before {
    background: linear-gradient(90deg, #e8a317, #f5c842);
}

.home-doc-card[data-cat="reunions"] .hdc-icon {
    background: #fce4ec;
}
.home-doc-card[data-cat="reunions"]::before {
    background: linear-gradient(90deg, #d81b60, #f06292);
}

.hdc-info {
    flex: 1;
    min-width: 0;
}

.hdc-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #007A3D;
    margin-bottom: 3px;
    line-height: 1.3;
}

.hdc-desc {
    font-size: 0.68rem;
    color: #aaa;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hide arrow in grid mode */
.hdc-arrow {
    display: none;
}

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

@media (max-width: 360px) {
    .home-doc-grid {
        gap: 8px;
    }
    .home-doc-card {
        padding: 16px 10px 14px;
    }
    .hdc-icon {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
    .hdc-title {
        font-size: 0.78rem;
    }
}

/* No results */
.no-results {
    text-align: center;
    padding: 40px 16px;
    color: #aaa;
}

.no-results p {
    font-size: 0.9rem;
}

/* === BOTTOM NAVIGATION === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: #aaa;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 12px;
    transition: color 0.2s;
}

.bottom-nav-item svg {
    transition: transform 0.2s;
}

.bottom-nav-item:hover svg {
    transform: scale(1.1);
}

.bottom-nav-item.active {
    color: #007A3D;
}

.bottom-nav-item.active svg {
    stroke: #007A3D;
}

/* === RESPONSIVE === */
@media (min-width: 480px) {
    .home-hero {
        min-height: 240px;
    }
    .hero-content {
        padding: 40px 32px;
    }
    .hero-greeting {
        font-size: 1.9rem;
    }
    .dom-avatar-img {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 360px) {
    .home-hero {
        min-height: 180px;
    }
    .hero-content {
        padding: 24px 18px;
    }
    .hero-greeting {
        font-size: 1.35rem;
    }
    .hero-tagline {
        font-size: 0.78rem;
        margin-bottom: 14px;
    }
    .dom-avatar-img {
        width: 90px;
        height: 90px;
    }
    .hdc-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
