/* Modern Responsive CSS for Expense Tracker PWA */

:root {
  --primary-color: #2196F3;
  --primary-dark: #1976D2;
  --primary-light: #BBDEFB;
  --accent-color: #FF5722;
  --success-color: #4CAF50;
  --warning-color: #FF9800;
  --error-color: #F44336;
  --text-primary: #212121;
  --text-secondary: #757575;
  --background: #FAFAFA;
  --surface: #FFFFFF;
  --border: #E0E0E0;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* Header */
#header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 2rem 0;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

/* Top Bar */
#topbar {
  background: var(--surface);
  padding: 1rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

#topbar ul {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}

#welcome {
  font-size: 1.1rem;
  color: var(--text-primary);
}

#logout a {
  background: var(--error-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

#logout a:hover {
  background: #D32F2F;
  transform: translateY(-1px);
}

/* Navigation */
#nav {
  background: var(--surface);
  padding: 1rem 0;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

#nav ul {
  display: flex;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  flex-wrap: wrap;
}

#nav a {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
  display: inline-block;
}

#nav a:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Forms */
form {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.regtable {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.regtable td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.regtable .heading {
  font-weight: 500;
  color: var(--text-primary);
  width: 30%;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: white;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  background: #388E3C;
}

.btn-danger {
  background: var(--error-color);
  color: white;
}

.btn-danger:hover {
  background: #D32F2F;
}

.btn-secondary {
  background: var(--text-secondary);
  color: white;
}

.btn-secondary:hover {
  background: #616161;
}

/* Tables */
.ExcelTable2007 {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.ExcelTable2007 th {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 500;
}

.ExcelTable2007 td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.ExcelTable2007 tr:hover {
  background: var(--primary-light);
}

.ExcelTable2007 .heading {
  background: var(--primary-dark);
  color: white;
  font-weight: 500;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Charts */
#piechart_3d {
  width: 100%;
  max-width: 800px;
  height: 400px;
  margin: 2rem auto;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hide { display: none; }
.show { display: block; }

/* Error and Success Messages */
.error {
  background: #FFEBEE;
  color: var(--error-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--error-color);
  margin-bottom: 1rem;
}

.success {
  background: #E8F5E8;
  color: var(--success-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--success-color);
  margin-bottom: 1rem;
}

.warning {
  background: #FFF3E0;
  color: var(--warning-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--warning-color);
  margin-bottom: 1rem;
}

/* Footer */
#footer {
  background: var(--surface);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 4rem;
  border-top: 1px solid var(--border);
}

#footer a {
  color: var(--primary-color);
  text-decoration: none;
}

#footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  #header {
    font-size: 2rem;
    padding: 1.5rem 0;
  }
  
  #topbar ul {
    flex-direction: column;
    gap: 1rem;
  }
  
  #nav ul {
    flex-direction: column;
    align-items: center;
  }
  
  #nav a {
    width: 100%;
    text-align: center;
  }
  
  form {
    padding: 1.5rem;
  }
  
  .ExcelTable2007 {
    font-size: 0.9rem;
  }
  
  .ExcelTable2007 th,
  .ExcelTable2007 td {
    padding: 0.75rem 0.5rem;
  }
  
  .table-container {
    margin: 0 -15px;
    border-radius: 0;
  }
  
  .desc-cell {
    max-width: 120px;
  }
  
  .action-cell {
    width: 60px;
  }
  
  .btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  
  #piechart_3d {
    height: 300px;
  }
}

@media (max-width: 480px) {
  #header {
    font-size: 1.5rem;
    padding: 1rem 0;
  }
  
  form {
    padding: 1rem;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .ExcelTable2007 {
    font-size: 0.8rem;
  }
  
  .ExcelTable2007 th,
  .ExcelTable2007 td {
    padding: 0.5rem 0.25rem;
  }
  
  .table-container {
    margin: 0 -15px;
    border-radius: 0;
  }
  
  .desc-cell {
    max-width: 80px;
  }
  
  .action-cell {
    width: 50px;
  }
  
  .btn-small {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
}

/* PWA Specific Styles */
.app-header {
  background: var(--primary-color);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0;
}

.floating-action-button {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  border: none;
  box-shadow: var(--shadow-hover);
  cursor: pointer;
  transition: var(--transition);
  z-index: 1000;
}

.floating-action-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* Table Container and Detail Page Styles */
.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.ExcelTable2007 {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.ExcelTable2007 thead {
  background: var(--primary-color);
  color: white;
}

.ExcelTable2007 thead th {
  padding: 1rem;
  text-align: left;
  font-weight: 500;
  border: none;
}

.ExcelTable2007 tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.ExcelTable2007 tbody tr:hover {
  background: var(--primary-light);
}

.ExcelTable2007 tbody tr:last-child {
  border-bottom: none;
}

.ExcelTable2007 tbody td {
  padding: 1rem;
  border: none;
}

.ExcelTable2007 tfoot {
  background: var(--background);
  font-weight: 500;
}

.ExcelTable2007 tfoot td {
  padding: 1rem;
  border: none;
}

/* Detail page specific styles */
.row-number {
  text-align: center;
  font-weight: 500;
  color: var(--text-secondary);
  width: 50px;
}

.date-cell {
  font-family: monospace;
  color: var(--text-primary);
}

.desc-cell {
  color: var(--text-primary);
  max-width: 200px;
  word-wrap: break-word;
}

.amount-cell {
  text-align: right;
  font-weight: 500;
  color: var(--primary-dark);
  font-family: monospace;
}

.claim-cell {
  text-align: center;
  font-weight: 500;
}

.claim-cell:contains("Yes") {
  color: var(--success-color);
}

.claim-cell:contains("No") {
  color: var(--text-secondary);
}

.action-cell {
  text-align: center;
  width: 80px;
}

.total-row {
  background: var(--primary-light) !important;
  font-weight: 600;
}

.total-label {
  text-align: right;
  color: var(--text-primary);
}

.total-amount {
  text-align: right;
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 1.1rem;
  font-family: monospace;
}

/* Small button variant */
.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Loading States */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #121212;
    --surface: #1E1E1E;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --border: #333333;
  }
}

/* Print Styles */
@media print {
  #topbar,
  #nav,
  .floating-action-button {
    display: none;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
} 