/* Recipe Sharing Hub - Modern UI Styles */

/* CSS Variables for consistent theming - Classic Bootstrap Style */
:root {
    --primary-color: #337ab7;
    --primary-dark: #286090;
    --secondary-color: #6c757d;
    --accent-color: #5cb85c;
    --success-color: #5cb85c;
    --warning-color: #f0ad4e;
    --danger-color: #d9534f;
    --info-color: #5bc0de;
    --dark-color: #222;
    --light-color: #f8f8f8;
    --border-color: #ddd;
    --text-color: #333;
    --text-muted: #777;
    --shadow: 0 1px 1px rgba(0,0,0,.05);
    --shadow-lg: 0 6px 12px rgba(0,0,0,.175);
    --border-radius: 4px;
    --transition: all 0.15s ease-in-out;
    --navbar-inverse-bg: #222;
    --navbar-inverse-border: #080808;
    --panel-bg: #fff;
    --panel-border: #ddd;
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.42857143;
    color: var(--text-color);
    background-color: #fff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Header and Navigation - Classic Bootstrap Inverse */
.navbar {
    background-color: var(--navbar-inverse-bg);
    border-color: var(--navbar-inverse-border);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    position: relative;
    min-height: 50px;
    margin-bottom: 20px;
}

.navbar-inverse {
    background-color: var(--navbar-inverse-bg);
    border-color: var(--navbar-inverse-border);
}

.navbar-brand {
    font-size: 18px;
    font-weight: normal;
    color: #9d9d9d !important;
    padding: 15px 15px;
    line-height: 20px;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: #fff !important;
    background-color: transparent;
}

.navbar-nav .nav-link {
    color: #9d9d9d !important;
    padding: 15px 15px;
    line-height: 20px;
    border-radius: 0;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: #fff !important;
    background-color: transparent;
}

.navbar-nav .active > .nav-link,
.navbar-nav .nav-link.active {
    color: #fff !important;
    background-color: var(--primary-color);
}

.navbar-toggler {
    border: none;
    color: var(--text-color);
}

/* Classic Bootstrap Panels */
.panel {
    margin-bottom: 20px;
    background-color: var(--panel-bg);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.panel-default {
    border-color: var(--panel-border);
}

.panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: calc(var(--border-radius) - 1px);
    border-top-right-radius: calc(var(--border-radius) - 1px);
    color: var(--text-color);
    background-color: #f5f5f5;
    border-color: var(--panel-border);
}

.panel-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    color: inherit;
}

.panel-body {
    padding: 15px;
}

.list-group {
    padding-left: 0;
    margin-bottom: 20px;
}

.list-group-item {
    position: relative;
    display: block;
    padding: 10px 15px;
    margin-bottom: -1px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    text-decoration: none;
}

.list-group-item:first-child {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.list-group-item:last-child {
    margin-bottom: 0;
    border-bottom-right-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

.list-group-item:hover,
.list-group-item:focus {
    color: var(--primary-dark);
    text-decoration: none;
    background-color: #f5f5f5;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(168, 216, 255, 0.3), rgba(199, 233, 255, 0.3)),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="food-pattern" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="2" fill="rgba(74,85,104,0.1)"/></pattern></defs><rect width="1000" height="1000" fill="url(%23food-pattern)"/></svg>');
    color: var(--text-color);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-shadow: none;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    background: white;
}

/* Removed general card hover effect per user request */

.card-img-top {
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

/* Removed card image hover effect per user request */

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.card-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Recipe Cards */
.recipe-card {
    position: relative;
    margin-bottom: 2rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

/* Removed hover effect per user request */

.recipe-card .card-img-top {
    height: 200px;
    object-fit: cover;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.recipe-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.recipe-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recipe-time {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.difficulty-easy { background-color: var(--success-color); color: var(--text-color); }
.difficulty-medium { background-color: var(--warning-color); color: var(--text-color); }
.difficulty-hard { background-color: var(--error-color); color: var(--text-color); }

/* Buttons - Classic Bootstrap Style */
.btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
}

.btn-default {
    color: var(--text-color);
    background-color: #fff;
    border-color: #ccc;
}

.btn-default:hover,
.btn-default:focus {
    color: var(--text-color);
    background-color: #e6e6e6;
    border-color: #adadad;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-dark);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background-color: var(--primary-dark);
    border-color: #204d74;
}

.btn-success {
    color: #fff;
    background-color: var(--success-color);
    border-color: #4cae4c;
}

.btn-info {
    color: #fff;
    background-color: var(--info-color);
    border-color: #46b8da;
}

.btn-warning {
    color: #fff;
    background-color: var(--warning-color);
    border-color: #eea236;
}

.btn-danger {
    color: #fff;
    background-color: var(--danger-color);
    border-color: #d43f3a;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--text-color);
}

/* Forms */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(168, 216, 255, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1.1rem;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(168, 216, 255, 0.25);
    outline: none;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--accent-color);
}

/* Filters */
.filters-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* Recipe Detail Page */
.recipe-header {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.recipe-image {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 2rem;
}

.recipe-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.recipe-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ingredients List */
.ingredients-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.ingredients-list {
    list-style: none;
    padding: 0;
}

.ingredients-list li {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.ingredient-checkbox {
    margin-right: 0.75rem;
}

/* Instructions */
.instructions-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.instruction-step {
    display: flex;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.instruction-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--text-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
}

.step-content {
    flex: 1;
    line-height: 1.6;
}

/* Nutrition Info */
.nutrition-info {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.nutrition-item {
    text-align: center;
    padding: 1rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.nutrition-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.nutrition-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Rating System */
.rating-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.rating-overview {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.rating-score {
    text-align: center;
}

.rating-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.rating-stars {
    margin: 0.5rem 0;
}

.rating-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.rating-bars {
    flex: 1;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.bar-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    width: 60px;
}

.bar-track {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--warning-color);
    transition: width 0.3s ease;
}

.bar-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    width: 40px;
    text-align: right;
}

/* Reviews */
.review-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

/* Square avatars with rounded corners */
.user-avatar-tiny {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.user-avatar-medium {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.user-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
}

.user-avatar-xl {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    object-fit: cover;
}

/* Override Bootstrap's rounded-circle for avatars */
img.user-avatar-tiny,
img.user-avatar-small,
img.user-avatar-medium,
img.user-avatar-large,
img.user-avatar-xl {
    border-radius: inherit !important;
}

/* Avatar placeholder for square shape */
.avatar-placeholder {
    border-radius: 12px !important;
}

/* Global override for all avatars - make them square with rounded corners */
img.rounded-circle.user-avatar-tiny,
img.rounded-circle.user-avatar-small,
img.rounded-circle.user-avatar-medium,
img.rounded-circle.user-avatar-large,
img.rounded-circle.user-avatar-xl,
img[src*="avatar"]:not(.keep-circle),
img[alt*="Chef"]:not(.keep-circle),
img[alt*="User"]:not(.keep-circle),
img[alt*="Profile"]:not(.keep-circle) {
    border-radius: 6px !important;
}

/* Larger avatars get more rounded corners */
img[width="40"], img[height="40"] {
    border-radius: 8px !important;
}

img[width="48"], img[height="48"],
img[width="50"], img[height="50"] {
    border-radius: 8px !important;
}

img[width="64"], img[height="64"],
img[width="80"], img[height="80"],
img[width="96"], img[height="96"],
img[width="100"], img[height="100"],
img[width="120"], img[height="120"],
img[width="150"], img[height="150"] {
    border-radius: 12px !important;
}

.reviewer-info h6 {
    margin: 0;
    font-size: 1rem;
}

.review-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Star Rating Input - Fixed Direction */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    gap: 0.25rem;
    margin: 1rem 0;
    justify-content: flex-end;
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--border-color);
    transition: var(--transition);
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input[type="radio"]:checked ~ label {
    color: var(--warning-color);
}

/* Flash Messages */
.alert {
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-error,
.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: rgba(69, 183, 209, 0.1);
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
}

/* Footer */
.footer {
    background: var(--light-color);
    color: var(--text-color);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer h5 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.footer a {
    color: var(--text-muted);
    transition: var(--transition);
}

.footer a:hover {
    color: var(--text-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .recipe-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rating-overview {
        flex-direction: column;
        text-align: center;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .instruction-step {
        flex-direction: column;
    }
    
    .step-number {
        align-self: flex-start;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .recipe-stats {
        grid-template-columns: 1fr;
    }
    
    .nutrition-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hover effects */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* AdSense styling */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--border-radius);
    border: 1px dashed var(--border-color);
}

.ad-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Footer Styles - Classic Bootstrap */
footer {
    margin-top: 50px;
}

.footer-blurb {
    background-color: #f8f8f8;
    padding: 40px 0;
    border-top: 1px solid #e7e7e7;
}

.footer-blurb-item {
    margin-bottom: 30px;
}

.footer-blurb-item h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.footer-blurb-item p {
    color: var(--text-muted);
    line-height: 1.6;
}

.small-print {
    background-color: #222;
    color: #ccc;
    padding: 20px 0;
}

.small-print p {
    margin: 0;
    text-align: center;
}

.small-print a {
    color: #ccc;
    text-decoration: none;
}

.small-print a:hover {
    color: #fff;
}

.thumbnail {
    display: block;
    padding: 4px;
    margin-bottom: 20px;
    line-height: 1.42857143;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border .2s ease-in-out;
}

.thumbnail:hover,
.thumbnail:focus {
    border-color: var(--primary-color);
    text-decoration: none;
}

.thumbnail img {
    width: 100%;
    height: auto;
}

/* Bootstrap 3 Labels/Badges */
.label {
    display: inline;
    padding: .2em .6em .3em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25em;
}

.label-default {
    background-color: #777;
}

.label-success {
    background-color: #5cb85c;
}

.label-warning {
    background-color: #f0ad4e;
}

.label-danger {
    background-color: #d9534f;
}

/* Bootstrap 3 Media Object */
.media {
    margin-top: 15px;
}

.media:first-child {
    margin-top: 0;
}

.media,
.media .media {
    zoom: 1;
    overflow: hidden;
}

.media-body {
    width: 10000px;
}

.media-left {
    float: left;
}

.media-left,
.media > .pull-left {
    margin-right: 10px;
}