/* MobileWise AI Dashboard - CSS for Grid Layout */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #ff6b6b;
    --success: #38b2ac;
    --warning: #ed8936;
    --light: #f7fafc;
    --dark: #2d3748;
    --gray: #a0aec0;
    --light-gray: #e2e8f0;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--dark);
    padding: 20px;
}

/* Header Styles */
.dashboard-header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--card-shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: contain;
}

.header-title h1 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.client-info {
    color: var(--gray);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-range select {
    padding: 10px 20px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
}

.date-range select:hover {
    border-color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-export, .btn-refresh, .btn-logout {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-export {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-refresh {
    background: var(--light-gray);
    color: var(--dark);
}

.btn-logout {
    background: var(--accent);
    color: white;
}

.btn-export:hover, .btn-refresh:hover, .btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Live Stats Bar */
.live-stats {
    display: flex;
    justify-content: space-around;
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

.live-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-label {
    font-weight: 500;
    color: var(--gray);
}

.live-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.live-unit {
    color: var(--gray);
    font-size: 14px;
}

/* Main Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-wide {
    grid-column: span 2;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.card-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    font-size: 24px;
}

.card-actions .btn-card {
    padding: 8px 16px;
    background: var(--light-gray);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.card-actions .btn-card:hover {
    background: var(--primary);
    color: white;
}

/* Metrics Styles */
.card-metrics {
    margin-bottom: 20px;
}

.metric-large {
    text-align: center;
    margin-bottom: 20px;
}

.metric-value {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.metric-label {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 5px;
}

.metric-trend {
    color: var(--success);
    font-size: 14px;
    font-weight: 500;
}

.metric-breakdown, .metric-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.breakdown-item, .detail-item {
    text-align: center;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.breakdown-label, .detail-label {
    display: block;
    color: var(--gray);
    font-size: 12px;
    margin-bottom: 5px;
}

.breakdown-value, .detail-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
}

/* Testimonial Types */
.testimonial-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.type-item {
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.type-price { background: rgba(255, 107, 107, 0.1); }
.type-time { background: rgba(56, 178, 172, 0.1); }
.type-trust { background: rgba(102, 126, 234, 0.1); }

.type-label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 5px;
}

.type-value {
    font-size: 18px;
    font-weight: 600;
}

/* Button Grid */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.button-metric {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    transition: var(--transition);
}

.button-metric:hover {
    background: #eef1ff;
    transform: translateX(5px);
}

.button-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.button-label {
    font-weight: 500;
    margin-bottom: 5px;
}

.button-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

.button-count {
    font-weight: 600;
    color: var(--primary);
}

.button-percent {
    font-size: 12px;
    color: var(--success);
    background: rgba(56, 178, 172, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Card Footer */
.card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--light-gray);
}

.roi-calculation {
    text-align: center;
}

.roi-label {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 5px;
}

.roi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.roi-note {
    font-size: 12px;
    color: var(--gray);
}

/* Activity Timeline */
.activity-timeline {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 15px;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.activity-time {
    color: var(--gray);
    font-size: 12px;
    min-width: 80px;
}

.activity-desc {
    font-size: 14px;
}

/* ROI Calculator */
.roi-calculator {
    margin-top: 20px;
}

.roi-input {
    margin-bottom: 20px;
}

.roi-input label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
}

.roi-input input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
}

.roi-input input:focus {
    border-color: var(--primary);
    outline: none;
}

.roi-results {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 20px;
}

.roi-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.roi-result:last-child {
    border-bottom: none;
}

.roi-result.highlight {
    background: rgba(102, 126, 234, 0.05);
    margin: 0 -20px;
    padding: 15px 20px;
    border-radius: 8px;
}

.result-label {
    color: var(--dark);
    font-weight: 500;
}

.result-value {
    font-weight: 600;
    font-size: 18px;
}

.roi-result.highlight .result-value {
    font-size: 22px;
    color: var(--primary);
}

/* Footer */
.dashboard-footer {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--card-shadow);
    margin-top: 30px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.footer-text p {
    margin-bottom: 5px;
}

.footer-sub {
    font-size: 12px;
    color: var(--gray);
}

.footer-right {
    text-align: right;
}

.footer-update {
    margin-bottom: 10px;
    color: var(--gray);
    font-size: 14px;
}

.footer-support a {
    color: var(--primary);
    text-decoration: none;
}

.footer-support a:hover {
    text-decoration: underline;
}

/* Chart Container */
.card-chart {
    height: 200px;
    margin-top: 20px;
    position: relative;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .card-wide {
        grid-column: span 1;
    }
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .header-left, .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .live-stats {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .metric-breakdown, .metric-details, .testimonial-types {
        grid-template-columns: 1fr;
    }
    
    .button-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-footer {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .footer-right {
        text-align: center;
    }
}

/* Animation for live updates */
@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

.live-value.updated {
    animation: pulse 1s ease-in-out;
}