/* Dashboard Theme Styles */

/* Dashboard Theme Colors - using CSS variables from styles.css */
.dashboard-theme {
    --hero-bg-color: var(--theme-dashboard);
    --hero-accent-color: #9C27B0;
    --hero-text-color: #fff;
    background: linear-gradient(135deg, var(--theme-dashboard) 0%, var(--theme-dashboard) 35%, var(--hero-accent-color) 100%);
    position: relative;
    overflow: hidden;
}

.dashboard-theme .farming-pattern-overlay {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Cpath d='M30 20v20M20 30h20' stroke='rgba(255,255,255,0.1)' stroke-width='2'/%3E%3Ccircle cx='30' cy='30' r='3' fill='rgba(255,255,255,0.15)'/%3E%3C/svg%3E");
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.dashboard-theme .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem 0;
    color: var(--hero-text-color);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-light);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-white);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    color: var(--text-dark);
    height: 100vh;
    position: sticky;
    top: 0;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    background-color: var(--theme-analytics);
    color: #fff;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar .logo i {
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(var(--theme-analytics-rgb), 0.05);
    border-left-color: var(--theme-analytics);
    color: var(--theme-analytics);
}

.nav-item.active {
    background-color: rgba(var(--theme-analytics-rgb), 0.1);
    border-left-color: var(--theme-analytics);
    color: var(--theme-analytics);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: var(--theme-analytics);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
}

.user-info .role {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Main Content */
.main-content {
    flex: 1;
    width: calc(100% - 250px);
    padding: 0;
}

/* Dashboard Header */
.dashboard-header {
    padding: 1.5rem 2rem;
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.header-left p {
    color: var(--text-light);
    margin-bottom: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    width: 250px;
    font-size: 0.9rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.notifications {
    position: relative;
    width: 40px;
    height: 40px;
    background-color: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--error-color);
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.language-selector select {
    padding: 0.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
}

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

.stat-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-card.weather .stat-icon {
    background-color: var(--theme-weather);
}

.stat-card.crops .stat-icon {
    background-color: var(--theme-crops);
}

.stat-card.alerts .stat-icon {
    background-color: var(--error-color);
}

.stat-card.revenue .stat-icon {
    background-color: var(--theme-pricing);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.weather-info, .crop-count, .alert-count, .revenue-amount {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-content p {
    font-size: 0.85rem;
    margin-bottom: 0;
}

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

/* Widgets */
.widget {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.widget-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-action {
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.widget-action:hover {
    background-color: var(--theme-analytics);
    color: #fff;
}

/* Weather Widget */
.weather-forecast {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.forecast-day .day {
    font-weight: 600;
    font-size: 0.9rem;
}

.forecast-day .weather-icon {
    font-size: 1.5rem;
    color: var(--theme-weather);
}

.forecast-day .temp {
    font-size: 0.85rem;
}

/* Crop Status */
.crop-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crop-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    align-items: center;
}

.crop-info {
    display: flex;
    flex-direction: column;
}

.crop-name {
    font-weight: 600;
}

.crop-stage {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--theme-crops);
}

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

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.activity-icon.irrigation {
    background-color: var(--theme-weather);
}

.activity-icon.fertilizer {
    background-color: var(--theme-crops);
}

.activity-icon.soil {
    background-color: var(--earth-brown);
}

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

.activity-title {
    font-weight: 600;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

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

.recommendation-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.recommendation-item.urgent {
    background-color: rgba(var(--error-color-rgb), 0.1);
}

.recommendation-item.medium {
    background-color: rgba(var(--warning-color-rgb), 0.1);
}

.recommendation-item.low {
    background-color: rgba(var(--success-color-rgb), 0.1);
}

.recommendation-priority {
    font-size: 1.5rem;
    display: flex;
    align-items: flex-start;
}

.recommendation-item.urgent .recommendation-priority {
    color: var(--error-color);
}

.recommendation-item.medium .recommendation-priority {
    color: var(--warning-color);
}

.recommendation-item.low .recommendation-priority {
    color: var(--success-color);
}

.recommendation-content h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.recommendation-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Market Prices */
.price-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.price-item:last-child {
    border-bottom: none;
}

.commodity {
    font-weight: 600;
}

.price {
    font-size: 0.95rem;
}

.price.up {
    color: var(--success-color);
}

.price.down {
    color: var(--error-color);
}

.change {
    font-size: 0.85rem;
    font-weight: 600;
}

.price.up + .change {
    color: var(--success-color);
}

.price.down + .change {
    color: var(--error-color);
}

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

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

.scheme-item:last-child {
    border-bottom: none;
}

.scheme-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.scheme-info p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.apply-btn {
    padding: 0.5rem 1rem;
    background-color: var(--theme-schemes);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.apply-btn:hover {
    background-color: var(--primary-dark);
}

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

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        width: calc(100% - 200px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .logo span,
    .nav-item span,
    .user-info {
        display: none;
    }
    
    .nav-item {
        padding: 1rem;
        justify-content: center;
    }
    
    .avatar {
        margin: 0 auto;
    }
    
    .main-content {
        width: calc(100% - 60px);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box input {
        width: 180px;
    }
}

@media (max-width: 576px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .nav-item {
        padding: 0.75rem;
        flex-direction: column;
        border-left: none;
        border-bottom: 3px solid transparent;
        font-size: 0.8rem;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--theme-analytics);
    }
    
    .nav-item span {
        display: block;
        font-size: 0.7rem;
    }
    
    .user-info {
        display: none;
    }
    
    .main-content {
        width: 100%;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    .search-box input {
        width: 140px;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
}

/* Light/Dark Mode Toggle Enhancement */
.theme-toggle {
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border-radius: 50%;
    background-color: var(--bg-light);
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: var(--border-color);
}

/* RGB Versions for opacity use */
:root {
    --theme-analytics-rgb: 103, 58, 183;
    --error-color-rgb: 244, 67, 54;
    --warning-color-rgb: 255, 152, 0;
    --success-color-rgb: 76, 175, 80;
}

/* Add Pulse Animation to Important Elements */
.pulse-animate {
    animation: pulse 2s infinite;
}

/* Additional Dashboard Animation */
.widget {
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.widget:nth-child(1) { animation-delay: 0.1s; }
.widget:nth-child(2) { animation-delay: 0.2s; }
.widget:nth-child(3) { animation-delay: 0.3s; }
.widget:nth-child(4) { animation-delay: 0.4s; }
.widget:nth-child(5) { animation-delay: 0.5s; }
.widget:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
