/* Flora MiniWash - Hold Challenge Styles */
.flora-distance-container {
    font-family: 'Montserrat', sans-serif;
    max-width: 100%;
    margin: 2rem 0;
    padding: 2rem;
    background: #fff9f9;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.flora-distance-title {
    color: #ff6b9c; /* Pink from the logo */
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.distance-ruler {
    position: relative;
    height: 80px; /* Increased height to accommodate labels */
    background: #f0e6ff; /* Light purple */
    margin: 30px 0 50px; /* Added bottom margin for labels */
    border-radius: 25px;
    overflow: visible; /* Changed to visible to show labels */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.distance-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #ff6b9c, #a45cff);
    border-radius: 25px;
    transition: width 1s ease-in-out;
    box-shadow: 0 0 10px rgba(164, 92, 255, 0.3);
}

.distance-milestone {
    position: absolute;
    top: 15px; /* Adjusted position */
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}

.distance-milestone .marker {
    width: 3px;
    height: 20px;
    background: #fff;
    margin: 0 auto 8px; /* Adjusted spacing */
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

.distance-milestone .label {
    font-size: 13px;
    font-weight: 700;
    color: #5a3d7a;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.9);
    padding: 3px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: inline-block;
    min-width: 60px;
}

.distance-current {
    position: absolute;
    top: -30px;
    transform: translateX(-50%);
    font-weight: 700;
    color: #ff3d7f;
    background: white;
    padding: 3px 10px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    white-space: nowrap;
    font-size: 14px;
}

.distance-summary {
    text-align: center;
    margin: 2rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #4a4a4a;
}

/* Form styles */
.flora-form {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin: 1.5rem 0;
}

.flora-form input[type="date"],
.flora-form input[type="number"],
.flora-form select {
    padding: 10px 15px;
    border: 2px solid #e0d0ff;
    border-radius: 8px;
    margin: 5px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.flora-form input:focus,
.flora-form select:focus {
    border-color: #a45cff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(164, 92, 255, 0.2);
}

.flora-form input[type="submit"] {
    background: #ff6b9c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.flora-form input[type="submit"]:hover {
    background: #ff3d7f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 156, 0.3);
}

/* Table styles */
.flora-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.flora-table th {
    background: #ffebf2;
    color: #d14d82;
    text-align: left;
    padding: 12px 15px;
    font-weight: 600;
}

.flora-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0e6ff;
}

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

.flora-table input[type="submit"].delete {
    background: #ff6b6b;
    margin-left: 10px;
}

.flora-table input[type="submit"].delete:hover {
    background: #ff3d3d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flora-form {
        display: flex;
        flex-direction: column;
    }
    
    .flora-form input,
    .flora-form select,
    .flora-form input[type="submit"] {
        width: 100%;
        margin: 5px 0;
    }
    
    .flora-table {
        display: block;
        overflow-x: auto;
    }
}

/* Form styles */
.flora-form {
    background: white;
    border-radius: 12px;
    padding: 1.8rem 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.flora-form h3 {
    color: #d14d82;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0e6ff;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 0;
    width: 100%;
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Ensure form controls take full width of their container */
.form-control,
select.form-control,
input[type="date"].form-control,
input[type="number"].form-control,
input[type="text"].form-control {
    width: 100%;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #5a3d7a;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0d0ff;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #fbf9ff;
    -webkit-appearance: none; /* Fix for iOS input shadows */
    -moz-appearance: none;
    appearance: none;
    height: auto; /* Allow natural height */
    min-height: 46px; /* Minimum touch target size */
}

.form-control:focus {
    border-color: #a45cff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(164, 92, 255, 0.15);
    background-color: #fff;
}

.form-group.form-submit {
    display: flex;
    align-items: flex-end;
    margin-top: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b9c, #ff4d88);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    height: 46px; /* Match input height */
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff5a8a, #ff3d7f);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 156, 0.3);
}

/* Adjust select arrow */
select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%235a3d7a%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65em auto;
    padding-right: 2.5rem;
}

/* Activities section */
.flora-activities {
    margin: 3rem 0 2rem;
    background: white;
    border-radius: 12px;
    padding: 1.8rem 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.flora-activities h3 {
    color: #d14d82;
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #f0e6ff;
}

.flora-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.flora-table thead {
    background: linear-gradient(135deg, #ffebf2, #fff5f9);
}

.flora-table th {
    color: #d14d82;
    text-align: left;
    padding: 1rem 1.2rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #ffd6e7;
}

.flora-table td {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid #f5f0ff;
    vertical-align: middle;
    background: #fff;
    transition: background 0.2s ease;
}

.flora-table tbody tr:hover td {
    background: #fefbff;
}

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

/* Table form elements */
.flora-table .form-control {
    width: 100%;
    padding: 0.5rem 0.8rem;
    font-size: 0.95rem;
    background: #fff;
    border: 1px solid #e0d0ff;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.flora-table .form-control:focus {
    border-color: #a45cff;
    box-shadow: 0 0 0 2px rgba(164, 92, 255, 0.15);
    outline: none;
}

/* Action buttons */
.actions {
    white-space: nowrap;
    text-align: right;
    padding-right: 0.5rem !important;
}

.actions form {
    display: inline-block;
    margin: 0 2px;
}

.btn-edit,
.btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.btn-edit {
    color: #4a90e2;
    background: rgba(74, 144, 226, 0.1);
}

.btn-edit:hover {
    background: rgba(74, 144, 226, 0.2);
    transform: translateY(-1px);
    opacity: 1;
}

.btn-delete {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.btn-delete:hover {
    background: rgba(255, 107, 107, 0.2);
    transform: translateY(-1px);
    opacity: 1;
}

/* Empty state */
.flora-table .empty-state {
    text-align: center;
    padding: 2rem !important;
    color: #8a7b9d;
    font-style: italic;
}

/* Responsive table */
@media (max-width: 768px) {
    .flora-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .flora-table th,
    .flora-table td {
        min-width: 120px;
    }
    
    .actions {
        white-space: nowrap;
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-group.form-submit {
        grid-column: span 2;
    }
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .form-group.form-submit {
        grid-column: span 1;
    }
    
    .btn-primary {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .flora-form {
        padding: 1.5rem 1.25rem;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
    }
    
    .flora-table {
        display: block;
        overflow-x: auto;
    }
    
    .flora-table th,
    .flora-table td {
        padding: 8px 10px;
    }
}

/* Animation for progress */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.distance-ruler:hover {
    animation: pulse 2s infinite;
}
