/* Layout and structure styles */

/* Main layout structure */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
}

.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 64px);
}

/* Header */
.top-nav {
    height: 64px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo:hover {
    text-decoration: none;
}

.logo-img {
    font-size: 1.5rem;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
    transition: all 0.3s ease-in-out;
    position: relative; /* Added for proper positioning of toggle button */
}

/* Collapsed sidebar state */
.sidebar-collapsed {
    width: 64px;
}

/* Sidebar toggle button */
.sidebar-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.sidebar-toggle:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-item {
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item a:hover {
    background-color: var(--bg-tertiary);
    text-decoration: none;
}

.nav-item.active a {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.nav-icon {
    width: 20px;
    min-width: 20px;
    text-align: center;
}

.nav-item-text {
    transition: opacity 0.2s ease;
}

.sidebar-collapsed .nav-item .nav-section-header a {
    padding: 0.625rem;
    justify-content: center;
}

.sidebar-collapsed .nav-item-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-collapsed .nav-item .nav-section-header a:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 60px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    white-space: nowrap;
}

.sidebar-collapsed .nav-section-toggle {
    display: none;
}

/* Main content area */
.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-primary);
}

.content-view {
    display: none;
    min-height: 100%;
}

.content-view.active {
    display: block;
}

.content-wrapper {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Page headers */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    margin-bottom: 0.25rem;
}

.welcome-message {
    color: var(--text-secondary);
    margin-bottom: 0;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dashboard-widget {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.widget-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.widget-header h2 {
    font-size: 1.125rem;
    margin: 0;
}

.widget-content {
    padding: 1rem;
}

/* Dashboard stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.stat-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Role switcher */
.role-switcher {
    display: flex;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    padding: 0.25rem;
    gap: 0.25rem;
}

.role-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-btn:hover {
    background-color: var(--bg-tertiary);
}

.role-btn[aria-pressed="true"] {
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.role-icon {
    font-size: 1rem;
}

/* User menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    color: var(--text-primary);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

.icon-chevron-down {
    font-size: 0.75rem;
}

/* Filters bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    gap: 1rem;
}

.timeline-time {
    width: 80px;
    font-weight: 500;
    color: var(--text-secondary);
}

.timeline-content {
    flex: 1;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 6px;
}

.meeting-badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.meeting-badge.organizer {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.meeting-badge.requester {
    background-color: var(--info-light);
    color: var(--info-dark);
}

.meeting-actions {
    margin-top: 0.5rem;
}

/* Activity feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.activity-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 1rem;
}

.activity-content {
    flex: 1;
}

.activity-time {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
}

/* Action list */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.action-icon {
    font-size: 1.5rem;
}

.action-content {
    flex: 1;
}

.action-content h4 {
    margin-bottom: 0.25rem;
}

.action-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Responsive layouts */
@media (max-width: 768px) {
    /* Hide regular sidebar on mobile - popup version in mobile.css */
    .workspace > .sidebar {
        display: none; /* Hide the normal sidebar layout */
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .role-switcher {
        flex-direction: column;
    }
    
    /* Make sure the main content takes the full width */
    .main-content {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 0 1rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .role-btn {
        padding: 0.5rem;
    }
    
    .role-text {
        display: none;
    }
}
