/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    line-height: 1.6;
    padding: 20px;
}

/* Modern Activity Log Styles */
.activity-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px;
    animation: fadeInUp 0.5s ease;
}

.activity-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    color: white;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.activity-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.activity-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    color: white !important;
}

.activity-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 8px 0 0 0;
    position: relative;
    z-index: 1;
}

.filters-section {
    background: white;
    padding: 24px 32px;
    border-bottom: 1px solid #e2e8f0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-weight: 600;
    color: var(--primary-green);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: #1e293b;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
    transform: translateY(-2px);
}

.clear-filters-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.clear-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.table-section {
    padding: 0;
    overflow: hidden;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin: 0;
}

.modern-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.modern-table th {
    padding: 20px 24px;
    text-align: left;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
}

.modern-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-blue));
}

.modern-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f5f9;
}

.modern-table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.modern-table td {
    padding: 20px 24px;
    border: none;
    vertical-align: middle;
    color: #334155;
    font-size: 0.95rem;
}

.time-cell {
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 600;
    color: var(--primary-green);
    white-space: nowrap;
}

.user-cell {
    font-weight: 600;
    color: #1e293b;
}

.activity-cell {
    position: relative;
}

.activity-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-badge.login {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.activity-badge.logout {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.activity-badge.delete {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.activity-badge.create {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.activity-badge.edit {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.activity-badge.test {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.activity-badge.other {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

.client-cell {
    font-style: italic;
    color: #64748b;
}

.empty-state {
    text-align: center;
    padding: 60px 32px;
    color: #64748b;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.stats-row {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #64748b;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-number {
    font-weight: 700;
    color: var(--primary-green);
    font-size: 1.1rem;
}

/* Legacy styles for backwards compatibility */
.container {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

table {
    width: 100%;
    border-collapse: collapse;
}
 
thead {
    background-color: #333;
    color: #fff;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

tbody tr:hover {
    background-color: #f1f1f1;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE CSS - SINGLE SECTION ONLY */

/* Mobile viewport fix */
@media screen and (max-width: 768px) {
  /* Prevent horizontal overflow */
  body {
    overflow-x: hidden;
    padding: 0;
  }
  
  /* Make navbar responsive */
  #navbar {
    left: 0;
    padding: 8px 16px;
    height: 65px;
  }
  
  #ClientSearch {
    max-width: 220px;
    margin: 0 8px;
  }
  
  #ClientSearch input {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 8px 12px;
  }
  
  
  /* Adjust main content */
  #rightsidepagecontainer {
    position: static;
    left: 0;
    top: 0;
    padding: 16px;
    margin-top: 65px;
  }
  
  /* Make activity container look better */
  .activity-container {
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  }
  
  .activity-header {
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
  }
  
  .activity-title {
    font-size: 2rem;
    margin-bottom: 8px;
  }
  
  .activity-subtitle {
    font-size: 1rem;
    opacity: 0.9;
  }
  
  /* Better filter layout - 2 columns on mobile */
  .filters-section {
    padding: 20px;
    background: white;
  }
  
  .filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }
  
  .filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .filter-label {
    font-weight: 600;
    color: var(--primary-green);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .filter-select,
  .filter-input {
    font-size: 16px; /* Prevents zoom */
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
  }
  
  .filter-select:focus,
  .filter-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
  }
  
  /* Clear button spans full width */
  .clear-filters-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  }
  
  .clear-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
  }
  
  /* FIXED: Make table horizontally scrollable with proper sizing */
  .table-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-radius: 0 0 12px 12px;
    position: relative;
    width: 100%;
    max-width: 100vw;
  }
  
  .modern-table {
    min-width: 480px;
    width: 480px; /* Fixed width instead of min-width */
    background: white;
    table-layout: fixed; /* This helps control column widths */
  }
  
  .modern-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  /* Fixed column widths that add up to 480px */
  .modern-table th:nth-child(1), /* TIME */
  .modern-table td:nth-child(1) {
    width: 140px;
    padding: 12px 8px;
    font-size: 0.75rem;
  }
  
  .modern-table th:nth-child(2), /* USER */
  .modern-table td:nth-child(2) {
    width: 100px;
    padding: 12px 8px;
    font-size: 0.8rem;
  }
  
  .modern-table th:nth-child(3), /* ACTIVITY */
  .modern-table td:nth-child(3) {
    width: 160px;
    padding: 12px 8px;
    font-size: 0.8rem;
  }
  
  .modern-table th:nth-child(4), /* CLIENT */
  .modern-table td:nth-child(4) {
    width: 80px;
    padding: 12px 8px;
    font-size: 0.8rem;
  }
  
  .modern-table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .modern-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
  }
  
  /* Specific cell styling */
  .time-cell {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-green);
  }
  
  .user-cell {
    font-weight: 600;
    color: #1e293b;
  }
  
  .activity-cell {
    /* Allow activity cell to wrap if needed */
    white-space: normal;
    line-height: 1.3;
  }
  
  .client-cell {
    color: #64748b;
    font-style: italic;
  }
  
  /* Smaller, more compact badges */
  .activity-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    display: inline-block;
    margin-bottom: 2px;
  }
  
  /* Activity description text under badge */
  .activity-cell div {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.2;
  }
  
  /* Better scroll hint */
  .table-section::after {
    content: '👆 Scroll horizontally to see all columns';
    display: block;
    text-align: center;
    padding: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    border-top: 1px solid #e2e8f0;
    font-style: italic;
  }
  
  /* Better stats layout */
  .stats-row {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    text-align: center;
    border-radius: 0 0 12px 12px;
  }
  
  .stats-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
  }
  
  .stats-number {
    font-weight: 700;
    color: var(--primary-green);
    font-size: 1.2rem;
  }
  
  /* Empty state improvements */
  .empty-state {
    padding: 40px 20px;
    text-align: center;
  }
  
  .empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
  }
  
  .empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
  }
}

/* Very small phones - more compact */
@media screen and (max-width: 480px) {
  .activity-title {
    font-size: 1.6rem;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .modern-table {
    min-width: 420px;
    width: 420px;
  }
  
  /* Even smaller column widths for tiny screens */
  .modern-table th:nth-child(1),
  .modern-table td:nth-child(1) {
    width: 120px;
  }
  
  .modern-table th:nth-child(2),
  .modern-table td:nth-child(2) {
    width: 90px;
  }
  
  .modern-table th:nth-child(3),
  .modern-table td:nth-child(3) {
    width: 140px;
  }
  
  .modern-table th:nth-child(4),
  .modern-table td:nth-child(4) {
    width: 70px;
  }
  
  .modern-table th,
  .modern-table td {
    padding: 10px 6px;
    font-size: 0.7rem;
  }
  
  .time-cell {
    font-size: 0.65rem;
  }
  
  .activity-badge {
    font-size: 0.55rem;
    padding: 2px 4px;
  }
  
  .activity-cell div {
    font-size: 0.65rem;
  }
  
  .stats-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}