/* ===========================================
   Relíquias Design System - Component Styles
   =========================================== */

/* ===========================================
   Layout - Fluid Containers (95% width)
   =========================================== */
.container-fluid {
    width: 92%; /* Must be between 90-95% */
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* For narrower content areas like forms */
.container-narrow {
    width: 92%; /* Must be between 90-95% */
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ===========================================
   Form Styles
   =========================================== */

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem; /* --space-6 */
}

/* Form Labels */
.form-label {
    display: block;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: #4A3B32;
    margin-bottom: 0.5rem;
}

/* Form Inputs & Textareas */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #E0D8D0;
    border-radius: 0.5rem;
    background-color: #FFFFFF;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-size: 1rem;
    color: #4A3B32;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, background-color 0.2s ease;
}

.form-input:hover {
    border-color: #C65D47;
}

.form-input:focus {
    outline: none;
    border-color: #C65D47;
    box-shadow: 0 0 0 3px rgba(198, 93, 71, 0.1), 0 1px 2px rgba(74, 59, 50, 0.05);
    background-color: #FFFFFF;
}

.form-input::placeholder {
    color: #9E9088;
    font-style: italic;
}

/* Textarea Specific */
.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Validation Errors */
.form-input.input-validation-error,
.form-input:invalid {
    border-color: #D9534F;
}

.text-danger,
.field-validation-error {
    color: #D9534F;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.validation-summary-errors {
    background-color: #FEF2F2;
    border: 1px solid #D9534F;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #D9534F;
}

/* Hide empty validation summary */
.validation-summary-errors:empty {
    display: none;
}

/* Hide validation summary that only contains empty ul */
.validation-summary-valid {
    display: none;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Inline Form Groups (for ingredients pattern) */
.form-inline-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.form-inline-group .form-input {
    flex: 1;
}

.grow-1 { flex: 1; }
.grow-2 { flex: 2; }
.grow-3 { flex: 3; }

/* ===========================================
   Button Styles - Enhanced with transitions
   =========================================== */

/* Primary Button */
.btn-primary {
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    background-color: #C65D47;
    color: #FFFFFF;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: #B04F3A;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(198, 93, 71, 0.25), 0 2px 4px -1px rgba(198, 93, 71, 0.1);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: none;
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(198, 93, 71, 0.3);
}

/* Secondary Button */
.btn-secondary {
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    background-color: #FFFFFF;
    color: #4A3B32;
    border: 1px solid #E0D8D0;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    border-color: #4A3B32;
    background-color: #EFEBE4;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px -1px rgba(74, 59, 50, 0.1);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 59, 50, 0.1);
}

/* Danger Button */
.btn-danger {
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    background-color: #D9534F;
    color: #FFFFFF;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background-color: #C9302C;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(217, 83, 79, 0.25), 0 2px 4px -1px rgba(217, 83, 79, 0.1);
}

.btn-danger:active {
    transform: translateY(0) scale(0.98);
    box-shadow: none;
}

.btn-danger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.3);
}

/* Button Sizes */
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-full {
    width: 100%;
}

/* ===========================================
   Card Styles - Enhanced
   =========================================== */

/* Form Card Container (for form pages) */
.form-card {
    width: 92%; /* Must be between 90-95% */
    max-width: 600px;
    margin: 0 auto;
    background-color: #FFFFFF;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(74, 59, 50, 0.08), 0 1px 2px rgba(74, 59, 50, 0.04);
    transition: box-shadow 0.3s ease;
}

.form-card-lg {
    max-width: 900px;
}

.form-card-full {
    max-width: 1800px;
}

/* Content Card - for content display pages (Groups Details, Profile, Feed, History, etc.) */
.content-card {
    background: #FFFFFF;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(74, 59, 50, 0.08);
    font-family: 'Inter', -apple-system, Helvetica, Arial, sans-serif;
    padding: 2rem;
}

/* Card hover utility class */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    box-shadow: 0 10px 15px -3px rgba(74, 59, 50, 0.08), 0 4px 6px -2px rgba(74, 59, 50, 0.04);
    transform: translateY(-2px);
}

/* ===========================================
   Image Hover Effect
   =========================================== */
.image-hover {
    overflow: hidden;
    border-radius: 0.5rem;
}

.image-hover img {
    transition: transform 0.4s ease;
}

.image-hover:hover img {
    transform: scale(1.05);
}

/* Form Actions Row */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E0D8D0;
}

/* Image Upload Area */
.upload-area {
    width: 100%;
    min-height: 200px;
    background-color: #EFEBE4;
    border: 2px dashed #E0D8D0;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #9E9088;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #C65D47;
    background-color: rgba(198, 93, 71, 0.04);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(74, 59, 50, 0.06);
}

.upload-area svg {
    width: 3rem;
    height: 3rem;
    transition: transform 0.3s ease;
}

.upload-area:hover svg {
    transform: scale(1.1);
}

/* ===========================================
   Toast Notification - Smooth animations
   =========================================== */
.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background-color: #FFFFFF;
    box-shadow: 0 20px 25px -5px rgba(74, 59, 50, 0.1), 0 10px 10px -5px rgba(74, 59, 50, 0.04);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid #8A9A5B;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.toast-success {
    border-left-color: #8A9A5B;
}

.toast-error {
    border-left-color: #D9534F;
}

.toast-exit {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(110%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(110%);
        opacity: 0;
    }
}

/* ===========================================
   Alert/Message Boxes
   =========================================== */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Hide empty alerts */
.alert:empty {
    display: none;
}

.alert-success {
    background-color: #F0F4E8;
    border: 1px solid #8A9A5B;
    color: #5A6B3D;
}

.alert-error {
    background-color: #FEF2F2;
    border: 1px solid #D9534F;
    color: #D9534F;
}

.alert-info {
    background-color: #FDF8F0;
    border: 1px solid #E3B74D;
    color: #8B6914;
}

/* ===========================================
   Link Styles
   =========================================== */
.link {
    color: #C65D47;
    text-decoration: none;
    transition: color 0.2s ease;
}

.link:hover {
    color: #B04F3A;
    text-decoration: underline;
}

/* ===========================================
   Divider
   =========================================== */
.divider {
    height: 1px;
    background-color: #E0D8D0;
    margin: 1.5rem 0;
}

/* ===========================================
   Text Helpers
   =========================================== */
.text-muted {
    color: #9E9088;
}

.text-center {
    text-align: center;
}

/* ===========================================
   Recipe Detail Card - Modern Layout
   =========================================== */

.recipe-card {
    background: #FFFFFF;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(74, 59, 50, 0.08);
    font-family: 'Inter', -apple-system, Helvetica, Arial, sans-serif;
}

.recipe-image-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.recipe-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.recipe-card:hover .recipe-image {
    transform: scale(1.02);
}

.recipe-content {
    padding: 2rem;
}

/* Header Section */
.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.recipe-title-section {
    flex: 1;
    min-width: 0;
}

.recipe-title {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #4A3B32;
    margin: 0.5rem 0;
    line-height: 1.2;
}

.recipe-title .version-tag {
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #9E9088;
    margin-left: 0.5rem;
}

.recipe-meta {
    font-size: 0.9rem;
    color: #9E9088;
}

.recipe-meta strong {
    color: #4A3B32;
    font-weight: 500;
}

/* Badges */
.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.badge-public {
    background-color: rgba(138, 154, 91, 0.15);
    color: #8A9A5B;
}

.badge-tag {
    background-color: rgba(138, 154, 91, 0.1);
    color: #8A9A5B;
    border: 1px solid rgba(138, 154, 91, 0.25);
    transition: background-color 0.2s;
}

.badge-tag:hover {
    background-color: rgba(138, 154, 91, 0.2);
}

/* Action Buttons */
.recipe-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

.action-group,
.action-group-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-icon {
    background: #EFEBE4;
    border: 1px solid #E0D8D0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4A3B32;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s;
    text-decoration: none;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
}

.btn-icon:hover {
    background: #E0D8D0;
    border-color: #4A3B32;
}

.btn-icon svg {
    width: 0.875rem;
    height: 0.875rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid #E0D8D0;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4A3B32;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s;
    text-decoration: none;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
}

.btn-outline:hover {
    border-color: #4A3B32;
    background: #EFEBE4;
}

.btn-outline svg {
    width: 0.875rem;
    height: 0.875rem;
}

.btn-outline-gold {
    color: #E3B74D;
    border-color: rgba(227, 183, 77, 0.3);
}

.btn-outline-gold:hover {
    background: rgba(227, 183, 77, 0.1);
    border-color: #E3B74D;
}

.btn-outline-danger {
    color: #D9534F;
    border-color: rgba(217, 83, 79, 0.3);
}

.btn-outline-danger:hover {
    background: rgba(217, 83, 79, 0.05);
    border-color: #D9534F;
}

/* Reactions */
.recipe-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 2rem;
}

.reaction-btn {
    padding: 0.5rem 1rem;
    border-radius: 1.25rem;
    border: 1px solid #E0D8D0;
    background: #FFFFFF;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    color: #9E9088;
}

.reaction-btn:hover {
    border-color: rgba(198, 93, 71, 0.3);
    color: #C65D47;
}

.reaction-btn.active {
    background: rgba(198, 93, 71, 0.1);
    border-color: rgba(198, 93, 71, 0.4);
    color: #C65D47;
    font-weight: 500;
}

/* Stats Grid */
.recipe-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-item {
    background: #F9F6F0;
    padding: 1.25rem;
    border-radius: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9E9088;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #4A3B32;
}

/* Section Header for sub-cards */
.section-header {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #4A3B32;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.section-header svg {
    width: 1.25rem;
    height: 1.25rem;
}

.section-header .count {
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #9E9088;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .recipe-header {
        flex-direction: column;
    }
    .recipe-actions {
        align-items: flex-start;
    }
    .recipe-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .recipe-title {
        font-size: 1.8rem;
    }
    .recipe-image-container {
        height: 250px;
    }
    .recipe-content {
        padding: 1.5rem;
    }
    .content-card {
        padding: 1.5rem;
    }
}

/* ===========================================
   US72: Video Player Styles
   =========================================== */
.video-player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #000;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
}

.video-overlay:hover {
    background: rgba(0, 0, 0, 0.4);
}

.video-overlay svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.video-duration-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
    font-family: var(--font-sans);
}

.video-processing {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-muted);
    font-family: var(--font-sans);
}

.video-processing .spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--color-border-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.75rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.video-failed {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-secondary);
    color: var(--color-danger);
    font-family: var(--font-sans);
    text-align: center;
    padding: 1rem;
}

.video-failed .error-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.video-failed .error-message {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}
