/* Variables */
:root {
    --primary-color: #22848c;
    --secondary-color: #eabc4b;
    --background-color: #f9f9f9;
    --text-color: #333;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    flex: 1;
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Navigation */
nav {
    background-color: var(--primary-color);
    padding: 1rem;
}

nav ul {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav ul li {
    display: flex;
    align-items: center;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

h2  {   
    color: var(--secondary-color);
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 18px;
    font-weight: bold;
    /*font-color: #22848c;*/
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    font-size: 16px;
}

input[type="number"],
input[type="date"]
{
    width: 300px;
    padding: 10px;
    border-radius: 4px;
    font-size: 16px;
}

/* Formulaire de recherche */
.search-container {
    margin-left: auto;
    min-width: 200px;
    flex-grow: 0;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 20px;
    padding: 5px 10px;
    max-width: 300px;
    height: 36px;
    margin-top: 17px
}

.search-form {
    display: flex;
    height: 100%;
    align-items: center;
    margin-bottom: 20px;
}

.search-form input {
    border: 0px;
    padding: 5px;
    min-width: 0;
    background: transparent;
    height: 100%;
}

.search-form input:focus {
    outline: none;
}

.search-form input[type="text"] {
    min-width: 200px;
}

.search-form .btn {
    margin-left: auto;
}

/* Boutons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #eabc4b;
    color: white;
}

.btn-success {
    background-color: #22848c;
    color: white;
}

.btn-success:hover {
    background-color: #eabc4b;
    color: white;
}

.btn-upload {
    background-color: #22848c;
    color: white;
    display: inline-flex;
    height: 38px;
    align-items: center;
    margin-bottom: 1px;
}

.btn-upload:hover {
    background-color: #eabc4b;
    color: white;
}

.button-group {
    display: flex;
    gap: 10px;
    padding: 12px;
}   

/* Tableaux */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
}

/* Largeurs fixes pour les colonnes */
.data-table th:nth-child(1) { width: 20%; } /* Bière */
.data-table th:nth-child(2) { width: 25%; } /* Brasserie */
.data-table th:nth-child(3) { width: 20%; } /* Style */
.data-table th:nth-child(4) { width: 10%; } /* Date */
.data-table th:nth-child(5) { width: 5%; } /* Utilisateur (si admin) */
.data-table th:nth-child(6) { width: 10%; } /* Statut (si admin) */
.data-table th:last-child { width: 10%; } /* Actions */

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

.data-table .actions {
    display: flex;
    gap: 5px;
    white-space: nowrap;
}

.sort-link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sort-link:hover {
    color: var(--secondary-color);
}

.sort-link.active {
    color: var(--secondary-color);
}

.sort-indicator {
    margin-left: 5px;
}

/* Alertes */
.alert {
    /*padding: 15px;*/
    /*margin-bottom: 20px;*/
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Badges de statut */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
}

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

.status-badge.private {
    background-color: var(--secondary-color);
    color: black;
}

/* Formulaires */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-control {
    width: 300px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* New Tasting form*/
.tasting-form {
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #22848c;
    margin-bottom: 30px;
}  

.form-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-column {    
    display:flex;
    flex-wrap:wrap;  
    flex-direction: row; 
    min-width: 200px;
    gap: 30px;  
    margin-bottom: 20px;
}

.inline-form {
    width: 100%;
    display:flex;
    flex-wrap: nowrap;
    gap: 30px;  
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.options-option {
    display: flex;
    align-items: center;
    gap: 5px;
}

.options-option input[type="checkbox"] {
    margin: 0;
}

.options-option label {
    margin: 0;
    font-size: 0.9em;
    cursor: pointer;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
}

.checkbox-item label {
    margin: 0;
    font-size: 0.9em;
    cursor: pointer;
}

/* Admin Section*/
.admin-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-color: #22848c;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* latest-tastings Section*/

.latest-tastings {
    background: transparent;
    padding: 20px;
    border-radius: 8px;
    border-color: #22848c;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* card tasting-card Section*/

.card.tasting-card   {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #22848c;
    margin-bottom: 30px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;    
    color: #2c3e50;
    border-bottom: 2px solid #22848c;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.card-body {    
}

.card-image {
    flex: 0 0 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    overflow: hidden;
}

.card-image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

/* profile-info */
.profile-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #22848c;
    margin-bottom: 30px;  
}   

/* Edit Tasting */

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Range Input Styling */
.range-container {
    position: relative;
    padding: 0px 60px 0px 0;
    margin-bottom: 20px;
}

.range-container label {
    display: block;
    margin-bottom: 15px;
}

.range-container input[type="range"] {
    width: 100%;
    background: transparent;
    margin: 0;
    -webkit-appearance: none;
}

.range-container input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 3px;
    background: #22848c;
    border: none;
}

.range-container input[type="range"]::-moz-range-track {
    width: 100%;
    height: 3px;
    background: #22848c;
    border: none;
}

.range-container input[type="range"]::-ms-track {
    width: 100%;
    width: 15px;
    background: #22848c;
    border: none;
}

.range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 25px;
    width: 15px;
    background: #22848c;
    cursor: pointer;
    margin-top: -23.5px;
}

.range-container input[type="range"]::-moz-range-thumb {
    height: 25px;
    width: 15px;
    background: #22848c;
    cursor: pointer;
    border: none;
}

.range-container input[type="range"]::-ms-thumb {
    height: 25px;
    width: 15px;
    background: #22848c;
    cursor: pointer;
    border: none;
}

.range-container input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--secondary-color);
}

.range-marks {
    /*position: absolute;*/
    top: 30px;
    left: 0;
    right: 60px;
    display: flex;
    justify-content: space-between;
    padding: 0;
    pointer-events: none;
}

.range-marks span {
    position: relative;
    font-size: 12px;
    color: #666;
    padding-bottom: 15px;
    pointer-events: none;
    user-select: none;
}

.range-marks span::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 5px;
    transform: translateX(-50%);
    width: 1px;
    height: 5px;
    background: #666;
    pointer-events: none;
}

.range-value {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    min-width: 40px;
    text-align: right;
    font-weight: bold;
    color: #22848c;
}

/* Texture Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 15px 0;
}

.options-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-option input[type="checkbox"] {
    margin: 0;
}

.options-option label {
    margin: 0;
    font-size: 14px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }

    /* Navigation responsive */
    nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        width: 100%;
        display: block;
    }

    /* Formulaires responsifs */
    .form-section {
        grid-template-columns: 1fr !important;
    }

    .form-group {
        margin-bottom: 15px;
    }

    /* Tableaux responsifs */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
        font-size: 14px;
    }

    /* Grilles responsives */
    .detail-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .options-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Boutons responsifs */
    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    .button-group .btn {
        width: 100%;
        text-align: center;
    }

    /* Cartes responsives */
    .tasting-card {
        flex-direction: column;
    }

    .card-image {
        margin-bottom: 15px;
    }

    /* Formulaire de recherche responsive */
    .search-container {
        width: 100%;
        margin: 10px 0;
    }

    .search-wrapper {
        width: 100%;
        max-width: none;
    }

    .search-form input[type="text"] {
        min-width: 0;
        width: 100%;
    }

    /* Inputs responsifs */
    input[type="number"],
    input[type="date"] {
        width: 100%;
    }

    /* Range inputs responsifs */
    .range-container {
        margin: 15px 0;
    }

    .range-marks {
        display: none;
    }

    /* Modal responsive */
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* Très petits écrans */
@media screen and (max-width: 480px) {
    .container {
        width: 100%;
        padding: 5px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .options-grid {
        grid-template-columns: 1fr !important;
    }

    .btn {
        padding: 10px;
        font-size: 16px;
    }

    .detail-item {
        padding: 10px;
    }

    /* Ajustements pour les tableaux sur très petits écrans */
    .data-table th,
    .data-table td {
        padding: 5px;
        font-size: 12px;
    }
}

.actions  { 
    padding-bottom: 15px;
}   

/* Image */
.detail-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.detail-grid {
    flex: 1;
}

.beer-image {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.beer-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background-color: #fff;
    padding: 1px;
}

@media (max-width: 768px) {
    .detail-container {
        flex-direction: column;
        align-items: center;
    }

    .beer-image {
        margin-top: 2rem;
    }
}

footer {
    margin-top: auto;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 20px 0;
    width: 100%;
}

/* Styles pour l'autocomplétion */
.ui-autocomplete {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ui-autocomplete .ui-menu-item {
    padding: 5px 10px;
    cursor: pointer;
    list-style: none;
}

.ui-autocomplete .ui-menu-item:hover {
    background-color: #f5f5f5;
}

.ui-autocomplete .ui-menu-item div {
    padding: 5px;
    font-size: 14px;
}

.autocomplete-list {
    width: auto !important;
    min-width: 200px;
}

/* Style pour la liste de suggestions */
.suggestions-list {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    margin: 0;
    padding: 0;
    list-style: none;
}

.suggestions-list li {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover {
    background-color: #f5f5f5;
}
