/* Estilos para Diary Grow */

/* Página de lista de diarios */
.diary-grow-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.list-header {
    text-align: center;
    margin-bottom: 50px;
}

.list-header h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.list-header .subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.add-diary-button {
    display: inline-block;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.add-diary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
    color: white;
    text-decoration: none;
}

.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.diary-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border: 2px solid #e8f5e9;
    transition: all 0.3s ease;
}

.diary-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(76, 175, 80, 0.25);
    border-color: #4CAF50;
}

.diary-card-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f5f5f5;
}

.diary-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.diary-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.diary-card:hover .diary-card-image img {
    transform: scale(1.05);
}

.diary-card-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.diary-card-image .placeholder-icon {
    font-size: 4em;
}

.diary-card-image .system-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(76, 175, 80, 0.95);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.diary-card-content {
    padding: 20px;
}

.diary-card-title {
    margin: 0 0 15px 0;
    font-size: 1.3em;
}

.diary-card-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.diary-card-title a:hover {
    color: #4CAF50;
}

.diary-card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.diary-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.crops-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.crop-tag {
    display: inline-block;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid #a5d6a7;
}

.diary-card-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.diary-card .read-more {
    display: inline-block;
    color: #4CAF50;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.diary-card .read-more:hover {
    color: #45a049;
}

.no-diaries {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.no-diaries-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.no-diaries h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.no-diaries p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.diary-pagination {
    text-align: center;
    margin: 40px 0;
}

.diary-pagination ul {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
}

.diary-pagination li {
    margin: 0;
}

.diary-pagination a,
.diary-pagination span {
    display: block;
    padding: 10px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
}

.diary-pagination a:hover {
    border-color: #4CAF50;
    color: #4CAF50;
}

.diary-pagination .current {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .diary-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .list-header h1 {
        font-size: 2em;
    }
    
    .diary-card-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Formulario de envío */
.diary-grow-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.diary-grow-form-container h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2em;
}

.diary-grow-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.diary-grow-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.diary-grow-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.diary-grow-message .icon {
    font-size: 1.5em;
}

.diary-grow-message a {
    color: inherit;
    font-weight: bold;
    text-decoration: underline;
}

#diary-grow-form,
#ia-grow-form {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.form-group-half {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.form-group .label-icon {
    margin-right: 5px;
}

.form-group .required {
    color: #e74c3c;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

/* Campo de título autogenerado */
.auto-generated-title {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #555;
    font-weight: 600;
    cursor: not-allowed;
    border: 2px solid #ddd;
}

.auto-generated-title:focus {
    border-color: #ddd;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.form-group label .auto-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

/* Badge de último valor en línea separada */
.last-value-info {
    margin-bottom: 8px;
    margin-top: -4px;
}

.last-value-info .auto-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

/* Etapa del Cultivo */
.growth-stage-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.stage-option {
    flex: 1;
    min-width: 200px;
    cursor: pointer;
    position: relative;
}

.stage-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.stage-label {
    display: block;
    padding: 20px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 12px;
    text-align: center;
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.stage-option:hover .stage-label {
    border-color: #4CAF50;
    background: #f1f8f4;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.stage-option.selected .stage-label,
.stage-option input[type="radio"]:checked + .stage-label {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #4CAF50;
    color: white;
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

@media (max-width: 768px) {
    .growth-stage-options {
        flex-direction: column;
    }
    
    .stage-option {
        min-width: 100%;
    }
    
    .stage-label {
        font-size: 1.2em;
        padding: 15px;
    }
}

/* Autocompletado de cultivos */
.form-group {
    position: relative;
}

.autocomplete-suggestions {
    display: none;
    position: absolute;
    background: white;
    border: 2px solid #4CAF50;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: -8px;
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #e8f5e9;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.form-group input[type="file"] {
    border: 2px dashed #e0e0e0;
    padding: 15px;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
}

/* Galería de imágenes en el formulario */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #e0e0e0;
    transition: all 0.3s ease;
}

.image-preview-item.primary {
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.image-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-preview-item .star-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-preview-item .star-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.image-preview-item .star-btn.active {
    background: #FFD700;
    color: #000;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-preview-item .remove-btn:hover {
    background: rgba(255, 0, 0, 1);
}

/* Imágenes existentes en modo edición */
.existing-images-notice {
    background: #e3f2fd;
    border: 2px solid #2196F3;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.existing-images-notice p {
    margin: 0 0 10px 0;
    color: #1976D2;
}

.existing-images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.existing-img-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
}

.existing-img-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.existing-img-item .badge-primary {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(255, 215, 0, 0.95);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
}

#image-preview {
    margin-top: 15px;
}

#image-preview img {
    max-width: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

.submit-button {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button .button-icon {
    font-size: 1.2em;
}

/* Vista de entrada individual */
.diary-grow-single {
    max-width: 900px;
    margin: 0 auto;
}

.diary-grow-entry {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.diary-grow-entry .entry-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
}

.diary-grow-entry .entry-title {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 15px;
}

.edit-diary-button {
    margin-bottom: 15px;
}

.btn-edit-diary {
    display: inline-block;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
}

.btn-edit-diary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
    color: white;
    text-decoration: none;
}

/* Galería de imágenes en la vista individual */
.diary-gallery {
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-main {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gallery-main img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.thumbnail-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.thumbnail-item.active {
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.thumbnail-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.thumbnail-item .primary-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 215, 0, 0.9);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8em;
}

/* Meta información arriba (fecha de publicación y autor) */
.diary-grow-entry .entry-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.diary-grow-entry .entry-meta-top span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.95em;
}

.diary-grow-entry .entry-meta-top .icon {
    font-size: 1.2em;
}

/* Meta información detallada (después de fotos) */
.diary-grow-entry .entry-meta-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e8f5e9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.diary-grow-entry .entry-meta-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.diary-grow-entry .entry-meta-details .icon {
    font-size: 1.1em;
}

.diary-grow-entry .system-type {
    background: #e8f5e9;
    padding: 8px 15px;
    border-radius: 20px;
    color: #2e7d32;
}

.diary-grow-entry .growth-stage {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 1.05em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.diary-grow-entry .crops-list {
    background: #e8f5e9;
    padding: 8px 15px;
    border-radius: 20px;
    color: #2e7d32;
}

.diary-grow-entry .start-date {
    background: #fff3e0;
    padding: 8px 15px;
    border-radius: 20px;
    color: #e65100;
}

.diary-grow-entry .start-date .days-badge {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    margin-left: 8px;
    font-weight: 600;
}

.diary-grow-entry .parameters {
    background: #e3f2fd;
    padding: 8px 15px;
    border-radius: 20px;
    color: #1565c0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.diary-grow-entry .parameters .param-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.diary-grow-entry .entry-thumbnail {
    margin: 30px 0;
    border-radius: 8px;
    overflow: hidden;
}

.diary-grow-entry .entry-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.diary-grow-entry .entry-content {
    line-height: 1.8;
    color: #333;
    margin: 30px 0;
}

.diary-grow-entry .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.diary-grow-entry .entry-content p {
    margin-bottom: 1.5em;
}

.diary-grow-entry .entry-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.diary-grow-entry .post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.diary-grow-entry .post-navigation a {
    padding: 12px 20px;
    background: #f5f5f5;
    border-radius: 6px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.diary-grow-entry .post-navigation a:hover {
    background: #4CAF50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.diary-grow-entry .nav-previous {
    flex: 1;
}

.diary-grow-entry .nav-next {
    flex: 1;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .diary-grow-entry {
        padding: 20px;
    }
    
    .diary-grow-entry .entry-title {
        font-size: 1.5em;
    }
    
    .diary-grow-entry .entry-meta-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .diary-grow-entry .entry-meta-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .diary-grow-entry .post-navigation {
        flex-direction: column;
    }
}

/* Estilos para el campo de acciones */
.actions-container {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.actions-section {
    flex: 1;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.actions-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.95em;
    color: #555;
    font-weight: 600;
}

.actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 80px;
}

.action-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.action-tag.available {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #90caf9;
    color: #1565c0;
}

.action-tag.available:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(33, 150, 243, 0.3);
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

.action-tag.done {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #81c784;
    color: #2e7d32;
}

.action-tag.done:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

.remove-action {
    font-size: 1.2em;
    font-weight: bold;
    color: #d32f2f;
    margin-left: 4px;
    cursor: pointer;
}

.remove-action:hover {
    color: #b71c1c;
    transform: scale(1.2);
}

/* Responsive para acciones */
@media (max-width: 768px) {
    .actions-container {
        flex-direction: column;
    }
}

/* Estilos para mostrar acciones en single post */
.diary-actions-performed {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef3 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    border-left: 4px solid #4CAF50;
}

.diary-actions-performed h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.diary-actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #81c784;
    border-radius: 8px;
    color: #2e7d32;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-badge::before {
    content: "✅";
    margin-right: 8px;
    font-size: 1.1em;
}

/* Botones de acción del diario */
.diary-action-buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.btn-edit-diary,
.btn-add-update {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-edit-diary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.btn-edit-diary:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    color: white;
}

.btn-add-update {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-add-update:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    color: white;
}

/* Estilos para actualizaciones del diario */
.diary-updates-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 3px solid #e0e0e0;
}

.updates-title {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.diary-updates-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 40px;
}

.diary-updates-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #4CAF50 0%, #81c784 100%);
    border-radius: 2px;
}

.diary-update-item {
    position: relative;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.diary-update-item:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateX(5px);
}

.update-timeline-marker {
    position: absolute;
    left: -34px;
    top: 25px;
    width: 20px;
    height: 20px;
    background: white;
    border: 4px solid #4CAF50;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.update-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.update-header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.update-date-below-badge {
    margin-top: 4px;
}

.growing-days-header {
    margin-left: auto;
}

.update-date {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.update-days-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ffb74d;
    border-radius: 20px;
    color: #e65100;
    font-size: 0.9em;
    font-weight: 600;
}

.update-growth-stage {
    margin-bottom: 15px;
}

.growth-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-weight: 700;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.update-parameters {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.param-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
}

.param-badge.ec {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #64b5f6;
    color: #1565c0;
}

.param-badge.ph {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    border: 2px solid #f06292;
    color: #c2185b;
}

.param-badge .icon {
    font-size: 1.1em;
}

.update-actions {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.update-actions h4 {
    margin: 0 0 12px 0;
    font-size: 1em;
    color: #2c3e50;
}

.update-actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.update-content {
    margin: 20px 0;
    color: #424242;
    line-height: 1.7;
    font-size: 1em;
}

.update-content p {
    margin-bottom: 15px;
}

.update-content p:last-child {
    margin-bottom: 0;
}

.update-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.update-image-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.update-image-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.update-image-link img {
    width: 100%;
    height: auto;
    display: block;
}

/* Formulario de actualización */
.diary-update-form {
    background: #f5f5f5;
}

.diary-info-box {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #81c784;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.diary-info-box p {
    margin: 8px 0;
    font-size: 1em;
    color: #2c3e50;
}

.diary-info-box p:first-child {
    margin-top: 0;
}

.diary-info-box p:last-child {
    margin-bottom: 0;
}

.cancel-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #f5f5f5;
    border: 2px solid #ccc;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cancel-button:hover {
    background: #e0e0e0;
    border-color: #999;
    color: #333;
    transform: translateY(-2px);
}

/* Responsive para actualizaciones */
@media (max-width: 768px) {
    .diary-action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-edit-diary,
    .btn-add-update {
        width: 100%;
        justify-content: center;
    }
    
    .diary-updates-timeline {
        padding-left: 30px;
    }
    
    .diary-updates-timeline::before {
        left: 8px;
    }
    
    .update-timeline-marker {
        left: -28px;
        width: 16px;
        height: 16px;
    }
    
    .update-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .growing-days-header {
        margin-left: 0;
        width: 100%;
    }
    
    .update-parameters {
        flex-direction: column;
        gap: 10px;
    }
    
    .update-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .diary-info-box {
        padding: 15px;
    }
}

/* Estilos para Perfil de Usuario - Mis Diarios */
.user-profile-page {
    background: #f5f5f5;
    min-height: 80vh;
}

.user-profile-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header del Perfil */
.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar img {
    border-radius: 50%;
    border: 4px solid #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.profile-info h1 {
    margin: 0 0 10px 0;
    font-size: 2em;
    color: #2c3e50;
}

.user-email,
.member-since {
    margin: 5px 0;
    color: #666;
    font-size: 1em;
}

/* AI Credit Widget */
.ai-credit-widget {
    margin-top: 14px;
    background: #f0f7f0;
    border: 1px solid #c8e6c9;
    border-radius: 10px;
    padding: 12px 16px;
    max-width: 320px;
}

.ai-credit-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ai-credit-icon {
    font-size: 18px;
    line-height: 1;
}

.ai-credit-title {
    font-weight: 700;
    font-size: 14px;
    color: #2c3e50;
    flex: 1;
}

.ai-credit-count {
    font-weight: 700;
    font-size: 14px;
    color: #2c3e50;
}

.ai-credit-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}

.ai-credit-badge.unlimited {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.ai-credit-badge.blocked {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.ai-credit-bar-wrap {
    background: #dcedc8;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.ai-credit-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.4s ease;
}

.ai-credit-renewal {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* Estadísticas del Perfil */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    font-size: 2.5em;
    display: block;
    margin-bottom: 10px;
}

.stat-number {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    color: #4CAF50;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 1em;
    color: #666;
    font-weight: 500;
}

/* Acciones del Perfil */
.profile-actions {
    margin-bottom: 30px;
    text-align: center;
}

.btn-new-diary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1em;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.btn-new-diary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(76, 175, 80, 0.4);
    color: white;
}

.btn-new-diary .icon {
    font-size: 1.3em;
}

/* Mensajes en el Perfil */
.profile-message {
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-message.success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #81c784;
    color: #2e7d32;
}

.profile-message .icon {
    font-size: 1.5em;
}

.profile-message p {
    margin: 0;
    font-weight: 500;
}

/* Sección de Diarios */
.my-diaries-section {
    margin-top: 40px;
}

.section-title {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

/* Grid de Diarios */
.my-diaries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* Tarjeta de Diario */
.my-diary-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.my-diary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.diary-card-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.diary-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.my-diary-card:hover .diary-card-image img {
    transform: scale(1.05);
}

.diary-card-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
}

.days-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(76, 175, 80, 0.95);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Contenido de la Tarjeta */
.diary-card-content {
    padding: 20px;
}

.diary-card-title {
    margin: 0 0 15px 0;
    font-size: 1.4em;
}

.diary-card-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.diary-card-title a:hover {
    color: #4CAF50;
}

/* Meta información */
.diary-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.95em;
}

.meta-item .icon {
    font-size: 1.2em;
}

.more-crops {
    padding: 2px 8px;
    background: #e0e0e0;
    border-radius: 10px;
    font-size: 0.85em;
    color: #666;
    font-weight: 600;
}

.meta-item.params {
    display: flex;
    gap: 12px;
}

.meta-item .param {
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9em;
}

/* Estadísticas de la tarjeta */
.diary-card-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    margin-bottom: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.diary-card-stats .stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    color: #666;
}

.diary-card-stats .icon {
    font-size: 1.2em;
}

/* Acciones de la Tarjeta */
.diary-card-actions {
    display: flex;
    gap: 10px;
}

.diary-card-actions a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.btn-view {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #64b5f6;
    color: #1565c0;
}

.btn-view:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    transform: translateY(-2px);
}

.btn-edit {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ffb74d;
    color: #e65100;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
    transform: translateY(-2px);
}

.btn-update {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #81c784;
    color: #2e7d32;
}

.btn-update:hover {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
    transform: translateY(-2px);
}

/* Estado vacío */
.no-diaries-message {
    text-align: center;
    padding: 60px 20px;
}

.empty-state {
    background: white;
    padding: 60px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 600px;
}

/* Modal de Procesamiento IA */
#ai-processing-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.ai-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.ai-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-spinner::before,
.ai-spinner::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #4CAF50;
    opacity: 0.6;
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.ai-spinner::after {
    animation-delay: 1s;
    background-color: #2196F3; /* Celeste/Azul */
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

#ai-processing-status {
    font-size: 1.2em;
    color: #1e293b;
    font-weight: 600;
    margin-top: 15px;
    animation: fadeText 2s infinite;
}

@keyframes fadeText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ai-modal-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
/* Toggle Switch for AI Visibility */
.ai-visibility-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  margin-bottom: 0; /* Reset default margin */
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.toggle-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
}

  
/* Estilos para validaciones de formularios */  
.validation-message {  
    display: flex;  
    align-items: center;  
    gap: 8px;  
    margin-top: 8px;  
    padding: 10px 14px;  
    border-radius: 6px;  
    font-size: 0.9em;  
    animation: slideDown 0.3s ease;  
}  
  
.validation-message.error-message {  
    background-color: #ffebee;  
    border-left: 4px solid #d32f2f;  
    color: #c62828;  
}  
  
.validation-message.warning-message {  
    background-color: #fff3e0;  
    border-left: 4px solid #f57c00;  
    color: #e65100;  
}  
  
input.validation-error {  
    border-color: #d32f2f !important;  
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1) !important;  
}  
  
input.validation-warning {  
    border-color: #f57c00 !important;  
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.1) !important;  
}  
  
@keyframes slideDown {  
    from {  
        opacity: 0;  
        transform: translateY(-10px);  
    }  
    to {  
        opacity: 1;  
        transform: translateY(0);  
    }  
} 
