/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 600;
    color: #DA291C;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: #DA291C;
}

.user-info {
    color: #666;
    font-size: 0.9rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert ul {
    list-style-position: inside;
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.auth-box h1 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: #1d1d1f;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
}

.auth-link a {
    color: #DA291C;
    text-decoration: none;
    font-weight: 500;
}

.demo-info {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1d1d1f;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #DA291C;
}

.form-group textarea {
    resize: vertical;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-container {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #DA291C;
    color: #fff;
}

.btn-primary:hover {
    background-color: #91160d;
}

.btn-secondary {
    background-color: #8e8e93;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #636366;
}

.btn-success {
    background-color: #34c759;
    color: #fff;
}

.btn-success:hover {
    background-color: #28a745;
}

.btn-danger {
    background-color: #ff3b30;
    color: #fff;
}

.btn-danger:hover {
    background-color: #d70015;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.stats-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-card.alert {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.stats-card h3 {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d1d1f;
}

.stat-action {
    display: inline-block;
    margin-top: 0.5rem;
    color: #DA291C;
    text-decoration: none;
    font-size: 0.9rem;
}

.dashboard-section {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

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

.section-header h2 {
    font-size: 1.5rem;
    color: #1d1d1f;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table thead {
    background-color: #f5f5f5;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e5ea;
}

.table th {
    font-weight: 600;
    color: #1d1d1f;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: #f9f9f9;
}

.table .actions {
    display: flex;
    gap: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background-color: #ffc107;
    color: #000;
}

.badge-approved {
    background-color: #34c759;
    color: #fff;
}

.badge-rejected {
    background-color: #ff3b30;
    color: #fff;
}

.badge-success {
    background-color: #34c759;
    color: #fff;
}

.badge-inactive {
    background-color: #8e8e93;
    color: #fff;
}

.badge-primary {
    background-color: #DA291C;
    color: #fff;
}

/* Leaderboard */
.leaderboard-info {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.leaderboard-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leaderboard-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.leaderboard-item.rank-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.leaderboard-item.rank-silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.leaderboard-item.rank-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a055 100%);
}

.leaderboard-item.current-user {
    border: 3px solid #DA291C;
}

.rank {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

.medal {
    font-size: 2.5rem;
}

.rank-number {
    font-size: 1.5rem;
    color: #666;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-cert {
    font-size: 0.875rem;
    color: #666;
}

.user-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #DA291C;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
}

/* Admin */
.admin-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-radius: 8px;
    text-decoration: none;
    color: #1d1d1f;
    font-weight: 500;
    transition: all 0.2s;
}

.admin-nav a:hover {
    background: #f5f5f7;
}

.admin-nav a.active {
    background: #DA291C;
    color: #fff;
}

.admin-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.admin-panel,
.admin-list {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.review-card {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f5f5f7;
}

.task-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.default-points {
    font-size: 1.25rem;
    color: #DA291C;
}

.review-content {
    margin-bottom: 1.5rem;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1d1d1f;
}

.field p {
    color: #333;
}

.field-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e5ea;
}

.review-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.points-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.points-input {
    width: 100px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #000;
}

/* Misc */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.task-description {
    max-width: 400px;
}

.task-notes {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-style: italic;
}

.points-earned {
    color: #34c759;
}

.points-pending {
    color: #ffc107;
}

.points-rejected {
    color: #ff3b30;
}

.tasks-summary,
.users-summary,
.pending-count {
    background: #f5f5f7;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 2rem;
}

.summary-item {
    font-size: 0.9rem;
}

.link {
    color: #DA291C;
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

.awards-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.award-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.award-icon {
    font-size: 2rem;
}

.award-details h4 {
    margin-bottom: 0.25rem;
}

.award-reason {
    margin-top: 0.5rem;
    color: #666;
}

/* Footer */
.footer {
    background-color: #fff;
    padding: 2rem;
    margin-top: auto;
    text-align: center;
    color: #666;
    border-top: 1px solid #e5e5ea;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-content {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-item {
        flex-direction: column;
        text-align: center;
    }
    
    .user-stats {
        justify-content: center;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
