/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #2563eb;
    --primary-blue-dark: #1e40af;
    --secondary-blue: #3b82f6;
    --light-blue: #dbeafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-blue);
    background: var(--light-blue);
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--primary-blue);
    background: var(--light-blue);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 2px;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    opacity: 0;
}

.metric-card[data-animation="fade-in"] {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.metric-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    padding: 1rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    box-shadow: var(--shadow-md);
}

.metric-content {
    flex: 1;
}

.metric-title {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.metric-change {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}

.metric-change.positive {
    color: var(--success-green);
    background: #d1fae5;
}

.metric-change.negative {
    color: var(--danger-red);
    background: #fee2e2;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
}

.chart-card[data-animation="fade-in"] {
    animation: fadeInUp 0.6s ease forwards;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.chart-container {
    position: relative;
    height: 300px;
}

/* Table Card */
.table-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
}

.table-card[data-animation="fade-in"] {
    animation: fadeInUp 0.6s ease forwards;
}

.table-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table thead {
    background: var(--gray-50);
}

.activity-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}

.activity-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-600);
}

.activity-table tbody tr {
    transition: all 0.2s ease;
}

.activity-table tbody tr:hover {
    background: var(--gray-50);
    transform: scale(1.01);
}

.location-flag {
    display: inline-block;
    margin-right: 0.5rem;
}

.duration-badge {
    background: var(--light-blue);
    color: var(--primary-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Footer */
.footer {
    background: white;
    margin-top: 2rem;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
    text-align: center;
    color: var(--gray-600);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .nav-link {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 250px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .activity-table {
        font-size: 0.875rem;
    }

    .activity-table th,
    .activity-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .metric-card {
        flex-direction: column;
        text-align: center;
    }

    .metric-icon {
        min-width: 60px;
        font-size: 2rem;
        padding: 0.75rem;
    }

    .nav {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-link {
        text-align: center;
    }

    .activity-table th:nth-child(3),
    .activity-table td:nth-child(3) {
        display: none;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--primary-blue);
    color: white;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

/* Statistics Section Styles */
.stats-section {
    animation: fadeIn 0.5s ease;
}

.period-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.period-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-700);
}

.period-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-2px);
}

.period-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.advanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-box h3 {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.stat-big-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.stat-box p {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Settings Section Styles */
.settings-section {
    animation: fadeIn 0.5s ease;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.settings-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.settings-card h3 {
    color: var(--gray-800);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.setting-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

.setting-description {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    margin-left: 2rem;
}

.setting-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-top: 0.5rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.settings-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.settings-btn.primary {
    background: var(--primary-blue);
    color: white;
}

.settings-btn.primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.settings-btn.secondary {
    background: var(--gray-600);
    color: white;
}

.settings-btn.secondary:hover {
    background: var(--gray-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.settings-btn.danger {
    background: var(--danger-red);
    color: white;
}

.settings-btn.danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.settings-btn:not(.primary):not(.secondary):not(.danger) {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.settings-btn:not(.primary):not(.secondary):not(.danger):hover {
    background: var(--gray-200);
    border-color: var(--primary-blue);
}

.data-info {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.data-info p {
    margin: 0.5rem 0;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.data-info span {
    color: var(--primary-blue);
    font-weight: 600;
}

.info-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.info-card p {
    margin: 0.75rem 0;
    color: var(--gray-700);
}

.info-card code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: var(--primary-blue);
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .period-selector {
        flex-direction: column;
    }

    .period-btn {
        width: 100%;
    }
}

