* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Consolidated dashboard and main-content styles */
.dashboard,
.main-content,
.page {
    padding: 20px;
    max-width: 1200px;
    margin-left: 250px;
    margin-right: auto;
    width: calc(100% - 250px);
    box-sizing: border-box;
}

header,
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f5f5f5;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Level feature has been removed */

.user-name-display {
    font-weight: 500;
    color: #333;
}

/* Consolidated logout button styles */
.logout-button,
.refresh-button,
.download-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.logout-button:hover,
.refresh-button:hover,
.download-button:hover {
    background-color: #2980b9;
}

.download-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.widgets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 1000px;
}

.widget {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.widget:hover {
    transform: translateY(-5px);
}

.widget h2 {
    margin: 0 0 15px 0;
    color: #333;
}

.widget-content {
    color: #666;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Mini-graph styles */
.mini-graph-container {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading spinner */
.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

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

/* Mini skills visualization */
.mini-skills-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.mini-skill-bar {
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 5px 0;
}

.mini-skill-level {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 5px;
    animation: fillBar 1.5s ease-out forwards;
}

@keyframes fillBar {
    from {
        width: 0;
    }
}

/* Consolidated graph container styles */
.audit-graph-container,
.xp-graph-container,
.grades-graph-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    height: 450px;
    max-height: 60vh;
    overflow: hidden;
}

/* Consolidated table container styles */
.audit-table-container,
.xp-table-container,
.grades-table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

/* Consolidated table styles */
.audit-table,
.xp-table,
.grades-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.audit-table th,
.audit-table td,
.xp-table th,
.xp-table td,
.grades-table th,
.grades-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.audit-table th,
.xp-table th,
.grades-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.audit-table tr:hover,
.xp-table tr:hover,
.grades-table tr:hover {
    background-color: #f5f5f5;
}

/* Statistics Styles */
.statistics-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.graph-controls {
    margin-bottom: 20px;
}

.graph-controls select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.graph-container {
    min-height: 400px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* XP page styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* XP graph */
.graph {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible;
    width: 100%;
    height: 100%;
    max-width: 100%;
}

.graph-tooltip {
    position: absolute;
    background: white;
    color: #333;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    white-space: pre-line;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

/* Login Form Styles */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    gap: 20px;
}

.login-title {
    text-align: center;
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 24px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form input {
    width: 100%;
    padding: 10px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

/* Password container styles */
.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    width: 100%;
    padding-right: 40px; /* Make room for the toggle button */
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #3498db;
}

.login-form input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.login-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-form button:hover {
    background: #2980b9;
}

.login-form button:active {
    transform: translateY(1px);
}

/* Add error state styles */
.login-form input.error {
    border-color: #e74c3c;
}

.login-form .error-message {
    color: #e74c3c;
    font-size: 14px;
    background-color: #fde8e8;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #f8d7da;
    text-align: center;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: #2c3e50;
    padding: 20px 0;
    color: white;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.sidebar-item:hover {
    background-color: #34495e;
}

.sidebar-item.active {
    background-color: #3498db;
}

.sidebar-icon {
    margin-right: 15px;
    font-size: 1.2em;
}

.sidebar-title {
    font-size: 1rem;
}

/* Header Styles */
.app-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 250px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 100;
    width: calc(100% - 250px);
    box-sizing: border-box;
}

/* Update profile widget styles */
.profile-widget {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.profile-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.user-info {
    flex-grow: 1;
}

.user-info h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.user-details {
    margin-top: 8px;
}

.user-details p {
    margin: 4px 0;
    color: #666;
    font-size: 0.9rem;
}

.error-message {
    color: #dc2626;
    background-color: #fee2e2;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
    text-align: center;
}

.error-message:not([hidden]) {
    display: block;
}

/* Main content area */
main {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(100% - 250px);
    box-sizing: border-box;
}

/* Dashboard specific styles */
.dashboard-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Dashboard adjustment */
.dashboard {
    margin-top: 80px;
}

/* Profile Section Styles */
.profile-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-top: 80px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 30px;
    width: 100%;
    box-sizing: border-box;
    max-width: 1000px;
}

.profile-image-container {
    width: 150px;
    height: 250px;
    border-radius: 5%;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-avatar {
    width: 100%;
    height: 100%;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
}

.user-name {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
    font-weight: bold;
}

.user-full-name {
    margin: 4px 0;
    font-size: 30px;
    color: #666;
    font-weight: bold;
}

.error {
    color: #ff0000;
    padding: 10px;
    background: #ffe6e6;
    border-radius: 4px;
    text-align: center;
    margin-top: 50px;
    font-size: 16px;
    font-weight: bold;
    border: 1px solid #ff0000;
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.2);
}

.profile-info {
    padding: 20px;
    margin-top: 5px;
}

.profile-info-section {
    background: #f5f5f5;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.profile-info-section h2 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.activities-list {
    max-height: 200px;
    overflow-y: auto;
}

.profile-info p {
    margin: 8px 0;
    line-height: 1.5;
    margin: 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

/* Toggle switch styles */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggle-label {
    font-size: 1rem;
    color: #2c3e50;
}

/* Remove redundant logout-btn */
.logout-btn {
    display: none;
}

/* Skills Matrix Styles */
.skills-matrix-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.skills-category {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.skills-category h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skill-item {
    display: flex;
    align-items: center;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.skill-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.skill-name {
    width: 150px;
    min-width: 100px;
    font-weight: 500;
    color: #333;
    flex-shrink: 0;
}

.skill-bar {
    flex-grow: 1;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    min-width: 50px;
}

.skill-level {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9, #3498db);
    background-size: 200% 100%;
    border-radius: 6px;
    position: relative;
    width: 0;
    transition: width 1.2s ease-out;
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: 200px 0;
    }
}

/* Section headings */
.section-heading {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Add menu toggle button styles */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    color: #333;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .widgets-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 1000;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .dashboard,
    .page,
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .app-header {
        left: 0;
        width: 100%;
    }

    .widgets-container {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-image-container {
        margin-bottom: 20px;
    }

    .user-info {
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }

    .sidebar {
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }
    
    .skill-name {
        width: 100px;
        min-width: 80px;
        font-size: 0.9rem;
    }
    
    .skills-category {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0 10px;
    }

    .user-section {
        gap: 10px;
    }

    .dashboard, .dashboard-page {
        padding: 10px;
    }

    .widget {
        padding: 15px;
    }

    .profile-section {
        padding: 15px;
    }

    .profile-image-container {
        width: 120px;
        height: 200px;
    }

    .user-full-name {
        font-size: 24px;
    }

    .login-container {
        margin: 50px auto;
        padding: 20px;
        max-width: 90%;
    }

    .login-title {
        font-size: 20px;
    }
    
    .skill-name {
        width: 80px;
        min-width: 60px;
        font-size: 0.8rem;
    }
    
    .skill-bar {
        height: 10px;
    }
    
    .skills-category {
        padding: 10px;
    }
}