/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header */
.app-header {
    background: #2196F3;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.install-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.install-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main content */
.app-main {
    flex: 1;
    padding: 2rem;
}

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

.card h2 {
    color: #2196F3;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.card p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Punch buttons */
.punch-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    justify-content: center;
}

.btn-punch-in {
    background: #4CAF50;
    color: white;
    font-size: 1.2rem;
    padding: 1rem 2rem;
}

.btn-punch-out {
    background: #f44336;
    color: white;
    font-size: 1.2rem;
    padding: 1rem 2rem;
}

/* Status display */
.status-display {
    background: #e3f2fd;
    border: 1px solid #2196F3;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    font-weight: 500;
    color: #1976D2;
}

/* Feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.feature-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feature-card h3 {
    color: #2196F3;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #2196F3;
    color: white;
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Output area */
.output-area {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
    min-height: 100px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-x: auto;
}

/* Footer */
.app-footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .app-header h1 {
        font-size: 1.3rem;
    }

    .app-main {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .punch-buttons {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* PWA specific styles */
@media (display-mode: standalone) {
    .app-header {
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
}

/* Date Range Filter Styles */
.date-range-filter {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.date-range-filter h3 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.date-input-group {
    display: flex;
    flex-direction: column;
}

.date-input-group label {
    color: white;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.date-input {
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.date-input:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.date-quick-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.btn-quick-filter {
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-quick-filter:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateY(-2px);
}

.btn-quick-filter:active {
    transform: translateY(0);
}

/* Date Range Info Display */
.date-range-info {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    color: #667eea;
    font-weight: 500;
}

/* Enhanced Entry Items */
.entries-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.entry-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.entry-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.entry-header {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.entry-details {
    display: grid;
    gap: 0.5rem;
    color: #555;
}

.entry-details > div {
    padding: 0.25rem 0;
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .date-inputs {
        grid-template-columns: 1fr;
    }

    .date-quick-filters {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .date-quick-filters {
        grid-template-columns: 1fr;
    }
}


/* Delete Button Styling */
.btn-delete {
    background: #ff4444;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    float: right;
}

.btn-delete:hover {
    background: #cc0000;
    transform: scale(1.05);
}

.btn-delete:active {
    transform: scale(0.95);
}

/* Entry Date Display */
.entry-date {
    font-weight: bold;
    color: #667eea;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

/* Entry Edit Row */
.entry-edit-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.5rem;
    align-items: center;
    margin: 0.5rem 0;
}

.entry-edit-row label {
    font-weight: 500;
    color: #555;
}

/* Datetime Edit Input */
.datetime-edit {
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.datetime-edit:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.datetime-edit:hover {
    border-color: #667eea;
}

/* Entry Duration */
.entry-duration {
    font-weight: bold;
    color: #764ba2;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Mobile Responsive for Edit Controls */
@media (max-width: 768px) {
    .entry-edit-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .entry-edit-row label {
        font-size: 0.9rem;
    }

    .datetime-edit {
        width: 100%;
    }

    .btn-delete {
        float: none;
        display: block;
        width: 100%;
        margin-top: 0.5rem;
    }
}

.pay-rate {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
}

.pay-rate input {
  padding: 0.5rem;
  font-size: 1rem;
}


/* Entry delete button – right aligned, red */
.entry-item {
  position: relative;
}

.entry-item .delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: #c62828;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.entry-item .delete-btn:hover {
  color: #b71c1c;
  text-decoration: underline;
}

/* Compact summary single-line layout */
.summary-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.summary-line .amount {
  font-weight: 700;
  font-size: 1.4rem;
  color: #2e7d32;
}

.summary-line .hours {
  font-size: 0.9rem;
  color: #555;
}


/* Delete button - right aligned, red */
.entry-item button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: 1px solid #c62828;
  color: #c62828;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.entry-item button:hover {
  background: #c62828;
  color: white;
}

/* Summary single-line layout */
.summary-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.summary-line .amount {
  font-weight: 700;
  font-size: 1.4rem;
  color: #2e7d32;
}

.summary-line .hours {
  font-size: 0.9rem;
  color: #555;
}
