/* SpaySync Clinic PWA Styles */

:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --success-color: #2e7d32;
    --warning-color: #f57c00;
    --error-color: #c62828;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #ddd;
    --background-light: #f5f5f5;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--background-light);
}

/* App Layout */
.clinic-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
}

.user-info a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.user-info a:hover {
    color: white;
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 80px;
}

/* Bottom Navigation */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-item.active,
.nav-item:hover {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 0.75rem;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background: var(--primary-hover);
}

.action-btn .icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.action-btn.secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.action-btn.secondary:hover {
    background: var(--background-light);
}

/* QR Scanner */
.scanner-container {
    position: relative;
}

.scanner-instructions {
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-muted);
}

#qr-reader {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

#qr-reader video {
    border-radius: 12px;
}

.scanner-cancel {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 16px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

/* Certificate Card */
.cert-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.1s;
}

.cert-card:active {
    transform: scale(0.98);
}

.cert-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.cert-pet-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.cert-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.cert-status.reserved {
    background: #e3f2fd;
    color: #1565c0;
}

.cert-status.completed {
    background: #e8f5e9;
    color: var(--success-color);
}

.cert-status.reimbursed {
    background: #fff3e0;
    color: var(--warning-color);
}

.cert-details {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.cert-details span {
    display: block;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Scan Result */
.scan-result {
    text-align: center;
}

.scan-result-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.scan-result-icon.success {
    color: var(--success-color);
}

.scan-result-icon.error {
    color: var(--error-color);
}

.pet-info-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin: 24px 0;
    text-align: left;
}

.pet-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.pet-type {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    font-weight: 500;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Messages */
.message {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.message.error {
    background: #ffebee;
    color: var(--error-color);
}

.message.success {
    background: #e8f5e9;
    color: var(--success-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Not Found */
.not-found {
    text-align: center;
    padding: 48px 16px;
}

.not-found h1 {
    margin-bottom: 8px;
}

.not-found a {
    color: var(--primary-color);
}

/* Blazor Error UI */
#blazor-error-ui {
    background: #ffebee;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 16px;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    margin-left: 16px;
    color: var(--primary-color);
}

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

    .stat-value {
        font-size: 1.5rem;
    }
}
