/* ========================================
   Sistema de Gestión Gastronómica - CSS
   ======================================== */

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Nueva paleta de colores */
    --rosa: #FEAD9F;
    --ruby-grapefruit: #F26858;
    --melon: #DBF5C5;
    --venice: #6CBF84;
    --moss-river: #323339;

    /* Asignación de colores */
    --primary-color: #6CBF84;
    --primary-hover: #5AAF72;
    --secondary-color: #F26858;
    --success-color: #6CBF84;
    --danger-color: #F26858;
    --warning-color: #FEAD9F;
    --info-color: #DBF5C5;
    --bg-color: #ffffff;
    --bg-secondary: #DBF5C5;
    --text-color: #323339;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(50,51,57,0.1);
    --shadow-md: 0 4px 6px rgba(50,51,57,0.1);
    --shadow-lg: 0 10px 15px rgba(50,51,57,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8fafc;
}

/* Layout */
.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    background: var(--moss-river);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.navbar-project {
    color: var(--melon);
    font-weight: 400;
    margin-left: 0.5rem;
}

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

.navbar-menu a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-menu a:hover {
    color: var(--melon);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: 0.5rem;
    min-width: 200px;
    list-style: none;
    margin-top: 0;
    padding: 0.5rem 0;
    padding-top: 0.5rem;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-menu li a:hover {
    background-color: var(--bg-secondary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #E15848;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #E15848;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--venice);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    position: relative;
}

.alert-success {
    background: var(--melon);
    color: var(--text-color);
    border-left: 4px solid var(--venice);
    border: none;
    border-left: 4px solid var(--venice);
}

.alert-error {
    background: #FEF3F1;
    color: var(--text-color);
    border: none;
    border-left: 4px solid var(--ruby-grapefruit);
}

.alert-warning {
    background: #FFF4E6;
    color: var(--text-color);
    border: none;
    border-left: 4px solid var(--rosa);
}

.alert-info {
    background: #FEF3F1;
    color: var(--text-color);
    border: none;
    border-left: 4px solid var(--rosa);
}

.alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
}

/* Cards */
.project-card, .product-card, .ingredient-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover, .product-card:hover, .ingredient-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-image, .product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-info, .product-info, .ingredient-info {
    padding: 1.5rem;
}

.project-info h3, .product-info h3, .ingredient-info h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.project-stats, .project-stats-small {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
}

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

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    color: var(--venice);
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--venice);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-label {
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.dashboard-actions {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-color);
}

/* Tables */
.table {
    width: 100%;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.table th {
    background: var(--venice);
    color: white;
    font-weight: 600;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: var(--bg-secondary);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--venice) 0%, var(--moss-river) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--venice);
}

.login-box h2 {
    font-size: 1.125rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-weight: 400;
}

.login-form {
    margin-bottom: 1.5rem;
}

.login-info {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.375rem;
}

.login-info p {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state h2 {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer p {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-success {
    background: var(--venice);
    color: white;
}

.badge-warning {
    background: var(--rosa);
    color: white;
}

.badge-danger {
    background: var(--ruby-grapefruit);
    color: white;
}

.badge-info {
    background: var(--melon);
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }

    .navbar-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .dashboard-actions {
        flex-direction: column;
        width: 100%;
    }
}
