/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

body {
    background-color: #FFFFFF;
    font-family: Arial, sans-serif;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Sidebar */
.sidebar-container {
    width: 100px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar {
    width: 60px;
    height: 500px;
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.top-section {
    background-color: #e9e9e9;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon:hover {
    transform: scale(1.1);
}

.icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.top-section .icon svg {
    stroke: #444;
}

.dark-section {
    background-color: #222;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 20px 0;
}

.dark-section .icon.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* Header */
.header {
    background: #FFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 99;
    border-bottom: 1px solid #E0E0E0;
}

.logo img {
    width: 2cm;
    display: block;
}

.search-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.search-bar {
    background: #EAEAEA;
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    width: 100%;
    max-width: 600px;
}

.search-bar i {
    color: #767070;
    font-size: 1.25rem;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    margin-left: 0.5rem;
    font-size: 1rem;
    color: #333;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-icon {
    font-size: 1.5rem;
    cursor: pointer;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: #EAEAEA;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.user-avatar .bi-person-fill {
    font-size: 1.25rem;
    color: #333;
}

.username {
    font-size: 1rem;
    color: #333;
    white-space: nowrap;
}

/* Main Content */
.main-content {
    padding: 2rem;
    flex: 1;
    background-color: transparent;
    max-width: 100%;
    overflow-x: hidden;
}

/* Breadcrumb */
.breadcrumb-section {
    margin-bottom: 1.5rem;
}

.breadcrumb-text {
    color: #888;
    font-size: 0.875rem;
    font-weight: normal;
}

/* Projects Section */
.projects-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

/* CardsArea container to handle button alignment */
.CardsArea {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align items to the right */
    transition: all 0.3s ease;
}

/* Expanded state for CardsArea */
.CardsArea.expanded {
    background: #F8F8F8;
    border-radius: 16px;
    padding: 2rem;
    margin: 1rem 0;
}

.create-btn {
    background: #333;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* margin-bottom: 2rem; Add space between button and projects grid */
}

.create-btn:hover {
    background: #555;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 2rem 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    padding-top: 25px;
    width: 100%; /* Ensure grid takes full width */
    align-self: stretch; /* Override the flex-end alignment for the grid */
    transition: all 0.3s ease;
}

/* Expanded state for projects grid - scrollable area */
.projects-grid.expanded {
    grid-template-rows: auto auto; /* Allow for dynamic rows based on content */
    max-height: 500px; /* Height to accommodate 2 rows + some padding */
    overflow-y: auto;
    padding: 1rem;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
    grid-auto-rows: auto; /* Ensure additional rows are properly sized */
}

/* Fade effect for bottom row cards - only in normal state */
.project-card:nth-child(4),
.project-card:nth-child(5),
.project-card:nth-child(6) {
    opacity: 0.1;
    filter: brightness(0.9);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Remove fade effect in expanded state */
.projects-grid.expanded .project-card:nth-child(4),
.projects-grid.expanded .project-card:nth-child(5),
.projects-grid.expanded .project-card:nth-child(6) {
    opacity: 1;
    filter: brightness(1);
}

/* Hide cards beyond the first 6 in default state */
.project-card:nth-child(n+7) {
    display: none;
}

/* Show all cards in expanded state */
.projects-grid.expanded .project-card:nth-child(n+7) {
    display: flex;
}

.project-card {
    background: #EAEAEA;
    border-radius: 30px;
    padding: 1.5rem;
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    margin-top: 0;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-header h3 {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    flex: 1;
}

.user-avatars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.avatar {
    width: 24px;
    height: 24px;
    background: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    font-weight: bold;
}

.avatar i {
    font-size: 1rem;
    color: #000;
}

.more-count {
    font-size: 0.75rem;
    color: #666;
    margin-left: 0.25rem;
}

.project-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Fade effect for content within cards */
.project-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(rgba(234, 234, 234, 0), #EAEAEA 90%);
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.3s ease;
}

/* Remove content fade effect in expanded state */
.projects-grid.expanded .project-content::after {
    opacity: 0;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.history-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #555;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

/* Progressive fade for history items */
.history-item:nth-child(3) {
    opacity: 0.8;
}

.history-item:nth-child(4) {
    opacity: 0.6;
}

.history-item:nth-child(5) {
    opacity: 0.4;
}

.history-item:nth-child(6) {
    opacity: 0.2;
}

.item-number {
    margin-right: 0.5rem;
    font-weight: 500;
}

.item-text {
    flex: 1;
    margin-right: 0.5rem;
}

.item-date {
    color: #888;
    font-size: 0.75rem;
}

.project-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.nav-arrow {
    background: #333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nav-arrow:hover {
    background: #555;
}

.see-all-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    width: 100%; /* Ensure section takes full width */
    align-self: stretch; /* Override the flex-end alignment for the section */
}

.see-all-link {
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    font-style: italic;
}

.see-all-link:hover {
    text-decoration: underline;
}

/* Recipient List Section */
.recipient-list-section {
    margin-top: 3rem;
}

.recipient-list-section h1 {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 2rem;
}

.recipient-columns {
    display: grid;
    grid-template-columns: 60% 30%;
    gap: 3rem;
}

.recipient-column {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 450px;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.1);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.column-header h3 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
}

.add-btn {
    background: #333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-btn:hover {
    background: #555;
}

.recipient-content {
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* All Recipients Styling */
.alphabet-section {
    margin-bottom: 1.5rem;
}

.alphabet-header {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    background: #EAEAEA;
    border-radius: 50px;
    border-bottom: none;
}

.recipient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}

.recipient-item.highlighted {
    background: rgba(255, 255, 255, 0.5);
    margin: 0 -0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    border-bottom: 1px solid #ddd;
}

.recipient-name {
    font-weight: 500;
    color: #333;
}

.recipient-company {
    color: #666;
    font-size: 0.85rem;
}

/* Recipient Groups Styling */
.project-group {
    margin-bottom: 1.5rem;
}

.project-header {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    background: #EAEAEA;
    border-radius: 50px;
    border-bottom: none;
}

.group-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
    color: #555;
}

.group-item.highlighted {
    background: rgba(255, 255, 255, 0.5);
    margin: 0 -0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    border-bottom: 1px solid #ddd;
}

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

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .recipient-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
