/* Dashboard Styles */
:root {
    --stat-card-height: 120px;
    --chart-min-height: 350px;
    --card-radius: 16px;
    --mobile-stat-card-height: 100px;
    --mobile-chart-min-height: 280px;
}

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

.dashboard-stat-card {
    height: var(--stat-card-height);
    border-radius: var(--card-radius);
    border: none;
    background: white;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Gradient background effect */
.dashboard-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        225deg,
        var(--primary-light) 0%,
        var(--primary-color) 50%,
        transparent 50.1%
    );
    opacity: 0.1;
    transform: translateX(50%) translateY(-50%);
    transition: all 0.5s ease;
}

.dashboard-stat-card:hover::before {
    transform: translateX(30%) translateY(-30%);
    opacity: 0.15;
}

.dashboard-stat-card .card-content {
    height: 100%;
    padding: 1.5rem;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dashboard-stat-card .level {
    margin-bottom: 0 !important;
    align-items: center;
}

.dashboard-stat-card .heading {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-stat-card .title {
    color: var(--primary-color);
    margin-bottom: 0;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

/* Enhanced icon styles */
.dashboard-stat-card .icon.is-large {
    height: 3.5rem;
    width: 3.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    box-shadow: 0 4px 15px rgba(255, 92, 138, 0.25);
    transform: rotate(-10deg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* Icon shine effect */
.dashboard-stat-card .icon.is-large::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 30%,
        transparent 100%
    );
    transform: rotate(35deg);
    transition: all 0.5s ease;
}

.dashboard-stat-card:hover .icon.is-large {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 92, 138, 0.3);
}

.dashboard-stat-card:hover .icon.is-large::after {
    transform: translateX(100%) translateY(-100%) rotate(35deg);
}

/* Card hover effects */
.dashboard-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 92, 138, 0.15);
}

.dashboard-stat-card:hover .title {
    transform: scale(1.02);
}

/* Activity List Styling */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}

.activity-list::-webkit-scrollbar {
    width: 6px;
}

.activity-list::-webkit-scrollbar-track {
    background: transparent;
}

.activity-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.activity-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background: #f9f9f9;
}

.activity-icon {
    margin-left: 1rem;
    color: #3273dc;
    flex-shrink: 0;
}

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

.activity-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.activity-description {
    color: #666;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    line-height: 1.4;
}

.activity-time {
    font-size: 0.8rem;
    color: #999;
}

/* Chart Cards */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Enhanced Card Styles */
.card {
    border-radius: var(--card-radius);
    border: none;
    background: white;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.card .card-header-title {
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card .card-header-title .icon {
    color: var(--primary-color);
    background: rgba(255, 92, 138, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card .card-header-actions {
    display: flex;
    gap: 0.5rem;
}

.card .card-header-actions button {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    color: #666;
    transition: all 0.2s ease;
}

.card .card-header-actions button:hover {
    background: var(--background-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.card .card-content {
    padding: 1.5rem;
    position: relative;
}

.card.has-info-header {
    overflow: visible;
}

.card.has-info-header .info-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(255, 92, 138, 0.25);
}

.card.has-info-header .info-header-title {
    font-weight: 600;
}

.card.has-info-header .info-header-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.chart-card {
    min-height: var(--chart-min-height);
}

.chart-card .card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.chart-card .chart-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chart-card .chart-toolbar select,
.chart-card .chart-toolbar button {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.chart-card .chart-toolbar select:hover,
.chart-card .chart-toolbar button:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 92, 138, 0.1);
}

.chart-card .chart-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--background-color);
    border-radius: 12px;
    flex-wrap: wrap;
}

.chart-card .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 120px;
}

.chart-card .info-item .icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.chart-card .info-item .info-label {
    font-size: 0.8rem;
    color: #666;
}

.chart-card .info-item .info-value {
    font-weight: 600;
    color: #333;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.chart-card:hover .card-header-title .icon {
    transform: scale(1.1);
}

/* Responsive Design Enhancements */
@media screen and (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.25rem;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --stat-card-height: var(--mobile-stat-card-height);
        --chart-min-height: var(--mobile-chart-min-height);
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .dashboard-stat-card {
        height: auto;
        min-height: var(--mobile-stat-card-height);
    }

    .dashboard-stat-card .card-content {
        padding: 1.25rem;
    }

    .dashboard-stat-card .title {
        font-size: 2rem;
    }

    .dashboard-stat-card .icon.is-large {
        height: 3rem;
        width: 3rem;
    }
    
    .dashboard-stat-card .heading {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .card .card-header {
        padding: 1.25rem;
    }
    
    .card .card-content {
        padding: 1.25rem;
    }
    
    .card .card-header-title {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .card .card-header-title .icon {
        width: 2rem;
        height: 2rem;
        padding: 0.375rem;
    }
    
    .chart-card .chart-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .chart-card .chart-toolbar select,
    .chart-card .chart-toolbar button {
        width: 100%;
        text-align: center;
    }
    
    .chart-card .chart-info {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.875rem;
    }
    
    .chart-card .info-item {
        min-width: auto;
        justify-content: space-between;
    }
    
    .activity-list {
        max-height: 300px;
    }
    
    .activity-item {
        padding: 0.875rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .activity-icon {
        margin-left: 0;
        align-self: flex-start;
    }
    
    .activity-content {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .dashboard-stat-card .card-content {
        padding: 1rem;
    }
    
    .dashboard-stat-card .title {
        font-size: 1.75rem;
    }
    
    .dashboard-stat-card .heading {
        font-size: 0.8rem;
    }
    
    .dashboard-stat-card .icon.is-large {
        height: 2.5rem;
        width: 2.5rem;
    }
    
    .card .card-header,
    .card .card-content {
        padding: 1rem;
    }
    
    .card .card-header-title {
        font-size: 0.95rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .chart-card .chart-info {
        padding: 0.75rem;
    }
    
    .chart-card .info-item {
        padding: 0.5rem;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .activity-item {
        padding: 0.75rem;
    }
    
    .activity-title {
        font-size: 0.9rem;
    }
    
    .activity-description {
        font-size: 0.8rem;
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    .dashboard-stat-card,
    .card,
    .activity-item {
        cursor: default;
    }
    
    .dashboard-stat-card:hover,
    .card:hover {
        transform: none;
    }
    
    .dashboard-stat-card:active {
        transform: scale(0.98);
    }
    
    .card:active {
        transform: scale(0.99);
    }
    
    .chart-card .chart-toolbar select,
    .chart-card .chart-toolbar button {
        min-height: 44px;
        font-size: 16px;
    }
}

/* Pregnancy chart specific styles */
.pregnancy-chart-card {
    background: linear-gradient(135deg, #fff5f8, #ffffff);
}

.pregnancy-chart-card .card-header {
    background: var(--primary-gradient);
    color: white;
}

.pregnancy-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 92, 138, 0.05);
    border-radius: 12px;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 92, 138, 0.1);
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.chart-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.chart-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 0.9rem;
}

.chart-filters select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 92, 138, 0.1);
}

canvas {
    max-width: 100%;
    height: 300px !important;
}

.activity-card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.activity-card .table {
    margin-bottom: 0;
}

.activity-card .table th {
    background: var(--background-color);
    color: #333;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.activity-card .table td {
    padding: 1rem;
    border: none;
    border-bottom: 1px solid #f5f5f5;
}

.activity-card .table tr:hover {
    background: #f9f9f9;
}

.tag {
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.tag.is-warning {
    background: #fff3cd;
    color: #856404;
}

.tag.is-danger {
    background: #f8d7da;
    color: #721c24;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 92, 138, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.chart-wrapper {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.chart-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
}

.trimester-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fff5f8, #ffffff);
    border-radius: 12px;
}

.trimester-summary .stat-item {
    background: white;
    border: 2px solid rgba(255, 92, 138, 0.1);
}

.trimester-summary .stat-item .stat-label,
.trimester-summary .stat-item .stat-value {
    color: var(--primary-color);
}

.dashboard-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
}

.dashboard-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

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

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid rgba(255, 92, 138, 0.2);
    background: white;
    color: #666;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    min-width: 100px;
    text-align: center;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 92, 138, 0.2);
}

.filter-btn:active {
    transform: translateY(0);
}

.filter-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(255, 92, 138, 0.3);
}

.filter-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.filter-btn.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.filter-btn.active:hover::after {
    width: 100%;
    height: 100%;
}

.filter-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.filter-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Articles grid styles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.article-card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.article-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-badges {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.card-content {
    padding: 1.5rem;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: #333;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #666;
}

.card-actions {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f5f5f5;
    display: flex;
    gap: 0.5rem;
}

/* Additional responsive styles */
@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-image {
        height: 160px;
    }
    
    .dashboard-filters {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
        justify-content: center;
    }
    
    .filter-btn {
        flex: 1;
        min-width: auto;
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    .pregnancy-stats {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.75rem;
        padding: 0.875rem;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
    
    .stat-item .stat-value {
        font-size: 1.25rem;
    }
    
    .trimester-summary {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
        padding: 0.875rem;
    }
}

@media screen and (max-width: 480px) {
    .dashboard-filters {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
        border-radius: 20px;
    }
    
    .pregnancy-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .stat-item {
        padding: 0.625rem;
    }
    
    .stat-item .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-item .stat-value {
        font-size: 1.1rem;
    }
}

.menu-list a {
    border-radius: 8px;
}

.button {
    border-radius: 8px;
}

button .icon {
    pointer-events: none;
}

/* Notification styles */
#notificationsContainer .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
}

.notification-header {
    background: var(--background-color);
    padding: 1rem;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.notification-item.unread {
    background: #f0f7ff;
}

.notification-item:hover {
    background: #f9f9f9;
}

.notification-icon {
    margin-right: 0.75rem;
}

.notification-content {
    flex: 1;
}

.notification-time {
    font-size: 0.8rem;
    color: #999;
}