/* 
   Cat Tracker Premium Styles 
   Design: Modern, Playful, Clean
*/

:root {
    /* Vibrant Palette */
    --primary: #6C5CE7;
    /* Soft Purple */
    --primary-hover: #5649c0;
    --secondary: #00B894;
    /* Mint Green */
    --accent: #FD79A8;
    /* Pink/Salmon */

    --bg-color: #F8F9FA;
    --surface-color: #FFFFFF;
    --text-main: #2D3436;
    --text-muted: #636E72;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.12);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1e1e2e;
        --surface-color: #2b2b3b;
        --text-main: #f8f9fa;
        --text-muted: #a0a0b0;
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-muted);
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 80px;
    /* Space for specific mobile nav if needed, or just breathing room */
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Cat Card */
.cat-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(108, 92, 231, 0.2);
}

.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.cat-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #a8c0ff, #3f2b96);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cat-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.cat-info p {
    font-size: 0.9rem;
}

.cat-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.stat-chip {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-med, 12px);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-chip.overdue {
    background: rgba(253, 121, 168, 0.15);
    color: #e84393;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--surface-color);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.radio-group {
    display: flex;
    gap: 1rem;
}

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

/* Detail View */
.detail-view {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-weight: 500;
    cursor: pointer;
}

.back-link:hover {
    color: var(--primary);
}

.log-list {
    margin-top: 2rem;
}

.log-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    gap: 1rem;
}

.log-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-content {
    flex: 1;
}

.log-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Image Upload */
.image-upload-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 0.5rem;
}

.image-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px dashed rgba(108, 92, 231, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--primary);
    font-size: 1.5rem;
    transition: var(--transition);
    background-size: cover;
    background-position: center;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.image-preview:hover {
    border-color: var(--primary);
    background-color: rgba(108, 92, 231, 0.05);
}

.file-label {
    display: block;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1rem;
}

/* Edit Button */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Delete Actions */
.btn-danger {
    background-color: transparent;
    color: #ff7675;
    border: 1px solid #ff7675;
}

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

.delete-log-btn {
    background: none;
    border: none;
    color: #fab1a0;
    cursor: pointer;
    padding: 0.2rem;
    transition: color 0.2s;
}

.delete-log-btn:hover {
    color: #d63031;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.filter-chip {
    background: var(--bg-color);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.filter-chip:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}