:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent: #238636; /* GitHub green style */
    --accent-hover: #2ea043;
    --danger: #da3633;
    --primary-gradient: linear-gradient(135deg, #1f6feb, #238636);
    --input-bg: #0d1117;
    --border: #30363d;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
}

.view {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Login */
.login-container {
    margin: auto;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    text-align: center;
}

.login-container h1 {
    margin-bottom: 10px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: #1f6feb;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: transform 0.1s;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    border-radius: 12px;
    font-size: 16px;
    margin-top: 10px;
}

.error-msg {
    color: var(--danger);
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

/* Dashboard */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-small {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
}

.dog-cards-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .dog-cards-container {
        grid-template-columns: 1fr 1fr;
    }
}

.dog-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
}

.dog-header h3 {
    margin-top: 0;
    font-size: 1.5rem;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.stock-item:last-child {
    border-bottom: none;
}

.food-name {
    font-weight: 500;
    color: var(--text-secondary);
    flex: 1;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.qty-pill {
    background: #0d1117;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
    border: 1px solid var(--border);
}

.btn-control {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.btn-minus {
    background: var(--card-bg);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-plus {
    background: var(--accent);
}

/* History */
.history-section {
    margin-top: 30px;
}

.history-section h3 {
    color: var(--text-secondary);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

#history-list {
    list-style: none;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.history-action {
    font-weight: 500;
    color: var(--text-primary);
}

.history-time {
    font-size: 0.8rem;
    opacity: 0.7;
}

@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
    }
}

/* Alerts */
#alerts-container {
    margin-bottom: 20px;
}

.alert-banner {
    background-color: rgba(218, 54, 51, 0.15); /* Red with opacity */
    border: 1px solid var(--danger);
    color: #ff7b72;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease-in-out;
}

.alert-icon {
    font-size: 1.2rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats */
.stats-section {
    margin-top: 30px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
}

.stats-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.stats-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
}

.stats-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th, .stats-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.stats-table th {
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-table td:last-child {
    text-align: right;
    font-weight: 700;
}
