/**
 * Main Dashboard Styles
 * @package LivestockManager
 * @since 1.5.0
 */

/* Main Container */
.lm-main-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header Styles */
.lm-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.lm-welcome-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    padding: 20px 30px;
    border-radius: 16px;
    color: white;
    flex: 1;
}

.lm-welcome-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: rgba(255,255,255,0.9);
}

.lm-welcome-text h1 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.lm-welcome-text p {
    margin: 0;
    opacity: 0.9;
}

.lm-role-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-top: 8px;
}

.lm-date-card {
    background: #f8f9fa;
    padding: 15px 25px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.lm-date-card .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #3498db;
}

.lm-current-date {
    font-weight: 500;
    color: #2c3e50;
}

/* Stats Grid */
.lm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.lm-stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.lm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.lm-stat-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
}

.lm-stat-card.lm-stat-animals .lm-stat-icon .dashicons { color: #27ae60; }
.lm-stat-card.lm-stat-breeding .lm-stat-icon .dashicons { color: #e74c3c; }
.lm-stat-card.lm-stat-vaccinations .lm-stat-icon .dashicons { color: #3498db; }
.lm-stat-card.lm-stat-revenue .lm-stat-icon .dashicons { color: #f39c12; }

.lm-stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.lm-stat-label {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.lm-stat-trend {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.lm-stat-trend.positive { color: #27ae60; }
.lm-stat-trend.negative { color: #e74c3c; }
.lm-stat-trend.neutral { color: #f39c12; }

/* Modules Grid */
.lm-modules-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.lm-grid-cols-2 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.lm-grid-cols-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.lm-grid-cols-4 {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.lm-module-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.lm-module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* Add New Animal specific card styling */
.lm-module-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.lm-module-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: white;
}

.lm-module-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lm-module-title {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.lm-module-description {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #7f8c8d;
    line-height: 1.5;
}

.lm-module-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    align-self: flex-start;
}

/* Badge Color Variations */
.lm-module-badge.essential { background: #e8f5e9; color: #27ae60; }
.lm-module-badge.core { background: #ffebee; color: #e74c3c; }
.lm-module-badge.health { background: #e3f2fd; color: #3498db; }
.lm-module-badge.inventory { background: #fff3e0; color: #f39c12; }
.lm-module-badge.daily-ops { background: #e0f2f1; color: #1abc9c; }
.lm-module-badge.finance { background: #f3e5f5; color: #9b59b6; }
.lm-module-badge.analysis { background: #fff3e0; color: #e67e22; }
.lm-module-badge.roi { background: #e8f5e9; color: #2ecc71; }
.lm-module-badge.expenses { background: #e3f2fd; color: #3498db; }
.lm-module-badge.revenue { background: #e8f5e9; color: #27ae60; }
.lm-module-badge.records { background: #e3f2fd; color: #2980b9; }
.lm-module-badge.staff { background: #f3e5f5; color: #8e44ad; }
.lm-module-badge.tasks { background: #fffde7; color: #f1c40f; }
.lm-module-badge.attendance { background: #eceff1; color: #2c3e50; }
.lm-module-badge.personal { background: #f5f5f5; color: #7f8c8d; }

.lm-module-actions {
    padding: 15px 20px;
    border-top: 1px solid #ecf0f1;
}

.lm-module-btn {
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lm-module-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1a5276 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.lm-module-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Quick Actions Section */
.lm-quick-actions {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.lm-quick-actions h3 {
    margin: 0 0 20px 0;
    font-size: 1.4rem;
    color: #2c3e50;
}

.lm-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.lm-quick-action {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lm-quick-action:hover {
    background: #3498db;
    border-color: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.lm-quick-action .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Recent Activity Section */
.lm-recent-activity {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.lm-recent-activity h3 {
    margin: 0 0 20px 0;
    font-size: 1.4rem;
    color: #2c3e50;
}

.lm-activity-feed {
    min-height: 200px;
}

.lm-loading-spinner {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Modal Styles */
.lm-dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.lm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    overflow: hidden;
}


.lm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
}

.lm-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.lm-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lm-modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.lm-modal-content {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.lm-modal-loading {
    text-align: center;
    padding: 60px;
    color: #7f8c8d;
}

/* Alert Styles */
.lm-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.lm-alert-error {
    background: #ffebee;
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

.lm-alert-success {
    background: #e8f5e9;
    color: #27ae60;
    border-left: 4px solid #27ae60;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lm-main-dashboard {
        padding: 15px;
    }

    .lm-welcome-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .lm-quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .lm-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .lm-grid-cols-2,
    .lm-grid-cols-3,
    .lm-grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .lm-welcome-icon .dashicons {
        font-size: 36px;
        width: 36px;
        height: 36px;
    }

    .lm-welcome-text h1 {
        font-size: 1.4rem;
    }

    .lm-stat-number {
        font-size: 1.5rem;
    }
}
