/* CraftBrew responsive modern CSS theme */
:root {
    --primary-color: #d97706;
    --primary-hover: #b45309;
    --bg-dark: #1c1917;
    --bg-card: #262626;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --beer-color: #f59e0b;
    --wine-color: #9f1239;
    --cider-color: #84cc16;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f1f5f9;
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Navbar */
.navbar {
    background-color: var(--bg-dark);
    color: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fbbf24;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: #e7e5e4;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fbbf24;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #a8a29e;
}

.btn-logout {
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ef4444;
    border-radius: 4px;
}

.btn-logout:hover {
    background-color: #ef4444;
    color: #fff;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Layout container */
.container {
    max-width: 1500px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

/* Card UI */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-beer { background: #fef3c7; color: #92400e; }
.badge-wine { background: #ffe4e6; color: #9f1239; }
.badge-cider { background: #ecfccb; color: #365314; }
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #e0e7ff; color: #3730a3; }
.badge-bottled { background: #fef3c7; color: #78350f; }
.badge-completed { background: #dcfce7; color: #166534; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: background 0.2s;
}

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

.btn-secondary {
    background-color: #64748b;
    color: #fff;
}
.btn-secondary:hover {
    background-color: #475569;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
}

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

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s;
}

select.form-control {
    padding-right: 2rem;
    cursor: pointer;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* Tables */
.table-container {
    background: #fff;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

table:not(#stepsTable) {
    min-width: 650px;
}

table#stepsTable {
    width: 100%;
    min-width: 100%;
}

th, td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

table .form-control {
    padding: 0.45rem 0.6rem;
    font-size: 0.875rem;
    box-sizing: border-box;
}

table select.form-control {
    min-width: 100px;
    padding-right: 1.5rem;
}

table input[type="number"].form-control {
    min-width: 65px;
}

table input[type="text"].form-control {
    min-width: 90px;
}

th {
    background-color: #f8fafc;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

tr:hover {
    background-color: #f8fafc;
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    color: #a8a29e;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    font-size: 0.875rem;
}

footer a {
    color: #fbbf24;
    text-decoration: none;
}

/* Responsive navigation */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    .navbar-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--bg-dark);
        padding: 1rem;
        border-top: 1px solid #292524;
    }
    .navbar-nav.show {
        display: flex;
    }
}
