/* SBMS - Beautiful and Maintainable Styles */

/* Basic reset and layout */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: #2c3e50;
    line-height: 1.6;
}

/* Navigation - Beautiful gradient header */
.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

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

.user-info {
    color: #ecf0f1;
    font-size: 14px;
}

.language-selector select {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* BEAUTIFUL BUTTON SYSTEM - Enhanced with gradients and animations */

/* Base button styles - applies to ALL buttons and action links */
.btn,
button,
input[type="submit"],
a[href*="edit"],
a[href*="delete"], 
a[href*="view"],
a[href*="detail"],
a[href*="shopping-cart"],
a[href*="create"],
a[href*="add"],
a[href*="approve"],
a[href*="reject"] {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    margin: 0.2rem;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: white !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Button colors with beautiful gradients */
.btn-primary,
input[type="submit"],
a[href*="view"],
a[href*="detail"],
a[href*="brew/"]:not([href*="edit"]):not([href*="delete"]) {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.btn-primary:hover,
input[type="submit"]:hover,
a[href*="view"]:hover,
a[href*="detail"]:hover,
a[href*="brew/"]:not([href*="edit"]):not([href*="delete"]):hover {
    background: linear-gradient(135deg, #2980b9, #1f639a);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-success,
a[href*="create"],
a[href*="add"],
a[href*="approve"] {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.btn-success:hover,
a[href*="create"]:hover,
a[href*="add"]:hover,
a[href*="approve"]:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-warning,
a[href*="edit"] {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white !important;
}

.btn-warning:hover,
a[href*="edit"]:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-danger,
a[href*="delete"],
a[href*="reject"] {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.btn-danger:hover,
a[href*="delete"]:hover,
a[href*="reject"]:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Info buttons - beautiful blue gradient for view actions */
.btn-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Shopping cart specific - beautiful purple gradient */
.btn-shopping,
a[href*="shopping-cart"] {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.btn-shopping:hover,
a[href*="shopping-cart"]:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Small buttons for table actions - Standardized sizing */
.btn-sm,
.btn-small {
    padding: 4px 8px !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
    white-space: nowrap !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Ensure consistent button styling in tables */
.data-table .btn,
.data-table .btn-sm,
.data-table .btn-small,
table .btn,
table .btn-sm,
table .btn-small {
    padding: 4px 8px !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
    margin: 0 2px !important;
    white-space: nowrap !important;
}

/* Ensure View buttons in version history get proper styling */
.version-actions .btn.btn-small {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

/* Tables - Enhanced with gradients and better shadows */
.data-table,
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.data-table th,
table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.data-table td,
table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.data-table tr:hover,
table tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* Forms */
form {
    background: white;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

/* Override form styling for inline forms */
form[style*="display: inline"],
form.inline-form {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    display: inline !important;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Cards and layout - Enhanced with gradients */
.card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Status indicators - Enhanced with gradients */
.status-full { 
    background: linear-gradient(135deg, #28a745, #20c997); 
    color: white; 
    padding: 0.25rem 0.75rem; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(40,167,69,0.3);
}

.status-started { 
    background: linear-gradient(135deg, #ffc107, #ffcd39); 
    color: #212529; 
    padding: 0.25rem 0.75rem; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255,193,7,0.3);
}

.status-available { 
    background: linear-gradient(135deg, #17a2b8, #20c997); 
    color: white; 
    padding: 0.25rem 0.75rem; 
    border-radius: 20px; 
    font-size: 0.8rem; 
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: 0 2px 4px rgba(23,162,184,0.3);
}
.status-empty { background-color: #6c757d; color: white; padding: 0.25rem 0.5rem; border-radius: 3px; font-size: 0.8rem; }
.status-pending { background-color: #ffc107; color: #212529; padding: 0.25rem 0.5rem; border-radius: 3px; font-size: 0.8rem; }
.status-paid { background-color: #28a745; color: white; padding: 0.25rem 0.5rem; border-radius: 3px; font-size: 0.8rem; }
.status-rejected { background-color: #dc3545; color: white; padding: 0.25rem 0.5rem; border-radius: 3px; font-size: 0.8rem; }

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success { background-color: #d4edda; border-left: 4px solid #28a745; color: #155724; }
.alert-error { background-color: #f8d7da; border-left: 4px solid #dc3545; color: #721c24; }
.alert-warning { background-color: #fff3cd; border-left: 4px solid #ffc107; color: #856404; }
.alert-info { background-color: #d1ecf1; border-left: 4px solid #17a2b8; color: #0c5460; }

/* Recipe specific */
.version-badge {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 500;
}

.recipe-link {
    font-weight: 600;
    color: #007bff;
    text-decoration: none;
}

.recipe-link:hover {
    text-decoration: underline;
}

/* Brew links - SINGLE SOURCE OF TRUTH - consistent styling across all pages */
a.brew-link {
    font-weight: 600 !important;
    color: #3498db !important;
    text-decoration: none !important;
    background: transparent !important;
    display: inline !important;
}

a.brew-link:hover {
    color: #2980b9 !important;
    text-decoration: underline !important;
}

/* Maximum specificity to override any conflicting styles */
table td a.brew-link,
.data-table td a.brew-link,
.dry-hop-card a.brew-link,
.brew-info a.brew-link,
.hop-actions a.brew-link,
div a.brew-link {
    font-weight: 600 !important;
    color: #3498db !important;
    text-decoration: none !important;
    background: transparent !important;
}

table td a.brew-link:hover,
.data-table td a.brew-link:hover,
.dry-hop-card a.brew-link:hover,
.brew-info a.brew-link:hover,
div a.brew-link:hover {
    color: #2980b9 !important;
    text-decoration: underline !important;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    main {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .actions {
        justify-content: center;
    }
    
    .data-table,
    table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td,
    table th,
    table td {
        padding: 0.5rem;
    }
}

/* Keg Detail Page */
.keg-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.keg-detail .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.keg-detail .page-header h1 {
    color: #2c3e50;
    margin: 0;
}

.keg-info {
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.info-card h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    font-size: 1.1rem;
}

.info-card dl {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px 15px;
    margin: 0;
}

.info-card dt {
    font-weight: 600;
    color: #555;
    padding: 4px 0;
}

.info-card dd {
    color: #333;
    margin: 0;
    padding: 4px 0;
}

/* Status badges in keg detail */
.info-card .status-active,
.info-card .status-in-use {
    background-color: #27ae60;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.info-card .status-empty {
    background-color: #95a5a6;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.info-card .status-cleaning,
.info-card .status-maintenance {
    background-color: #f39c12;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.info-card .status-broken,
.info-card .status-out-of-order {
    background-color: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Keg History Section */
.keg-history {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    margin-top: 2rem;
}

.keg-history h2 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    font-size: 1.3rem;
}

/* Responsive design for keg detail */
@media (max-width: 768px) {
    .keg-detail {
        padding: 1rem;
    }
    
    .keg-detail .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .info-card dl {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .info-card dt {
        font-weight: 700;
        margin-top: 8px;
    }
}

/* Footer - Centered and styled */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    color: #6c757d;
    font-size: 0.9rem;
    border-top: 1px solid #dee2e6;
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(248,249,250,0.8));
}