/**
 * Pet Guide Form Styles
 * /public_html/places/assets/css/pet-guide-form.css
 *
 * 獨立 CSS 檔案，供 Modal 共用元件載入
 * @version 1.0
 * @date 2025-12-08
 */

/* Container */
.pet-guide-form-container {
    padding: 0;
}

.guide-form-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.guide-form-loading.hidden {
    display: none !important;
}

.guide-form-content {
    display: block;
}

.guide-form-content.hidden {
    display: none !important;
}

/* Error & Success States */
.guide-form-error {
    text-align: center;
    padding: 40px 20px;
}

.guide-form-error .material-icons {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 10px;
}

.guide-form-error p {
    color: #666;
    margin-bottom: 20px;
}

.guide-form-success {
    text-align: center;
    padding: 60px 20px;
}

.guide-form-success .material-icons {
    font-size: 4rem;
    color: #4caf50;
    margin-bottom: 16px;
}

.guide-form-success h3 {
    margin: 0 0 12px;
    color: #333;
}

.guide-form-success p {
    color: #666;
    margin-bottom: 20px;
}

.guide-form-success .points-earned {
    color: #f5a623;
    font-size: 1.125rem;
}

/* Header */
.guide-form-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f5a623 0%, #e09000 100%);
    color: white;
   
}

.guide-form-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff !important;
}

.guide-form-title .material-icons {
    font-size: 1.375rem;
    color: #fff !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.guide-form-subtitle {
    margin: 4px 0 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Auto Save Hint */
.auto-save-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #2e7d32;
    margin-bottom: 20px;
}

.auto-save-hint .material-icons {
    font-size: 1rem;
}

/* Section */
.guide-form-section {
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.section-title .material-icons {
    font-size: 1.25rem;
    color: #f5a623;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.section-title.main {
    font-size: 1rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #f5a623;
}

.optional-badge {
    font-size: 0.6875rem;
    font-weight: normal;
    color: #999;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* Save Indicator */
.save-indicator {
    font-size: 0.6875rem;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.save-indicator .material-icons {
    font-size: 0.875rem;
}

.save-indicator.saving {
    color: #999;
}

.save-indicator.saved {
    color: #4caf50;
}

.save-indicator.error {
    color: #f44336;
}

.rotating {
    animation: rotate 1s linear infinite;
}

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

/* Star Rating */
.rating-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.star-rating-input {
    display: flex;
    gap: 4px;
}

.star-btn {
    cursor: pointer;
    transition: transform 0.15s;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn .material-icons {
    font-size: 2rem;
    color: #ddd;
}

.star-btn.active .material-icons,
.star-btn:hover .material-icons {
    color: #ffc107;
}

.rating-label {
    font-size: 0.875rem;
    color: #666;
}

/* Textarea */
.guide-textarea {
    resize: vertical;
    min-height: 100px;
    font-size: .8rem;
}

.textarea-counter {
    text-align: right;
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
}

/* Photo Upload */
.photo-upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.photo-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Photo Upload Loading */
.photo-preview-item.uploading {
    background: #f5f5f5;
}

.photo-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.photo-delete-btn .material-icons {
    font-size: 0.875rem;
}

.photo-delete-btn:hover {
    background: #f44336;
}

.photo-add-btn {
    width: 80px;
    height: 80px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: #999;
    transition: all 0.2s;
}

.photo-add-btn:hover {
    border-color: #f5a623;
    color: #f5a623;
}

.photo-add-btn .material-icons {
    font-size: 1.5rem;
}

.photo-add-btn span:last-child {
    font-size: 0.6875rem;
}

.photo-hint {
    width: 100%;
    margin: 8px 0 0;
    font-size: 0.75rem;
    color: #999;
}

/* Facilities Accordion */
.facilities-accordion {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.facilities-accordion > li {
    border-bottom: 1px solid #eee;
}

.facilities-accordion > li:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #f9f9f9;
    text-decoration: none !important;
}

.category-icon {
    font-size: 1.375rem;
    color: #f5a623;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.category-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 1rem;
}

.category-count {
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
    background: #eee;
    padding: 4px 12px;
    border-radius: 12px;
}

.accordion-arrow {
    color: #999;
    transition: transform 0.2s;
}

.uk-open .accordion-arrow {
    transform: rotate(180deg);
}

.uk-accordion-content {
    padding: 0;
}

.items-list {
    padding: 8px 0;
}

/* Facility Item */
.facility-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.facility-item:last-child {
    border-bottom: none;
}

.facility-item.selected {
    background: #fff8f0;
}

/* Item Header */
.item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.item-icon {
    font-size: 1.25rem;
    color: #888;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.facility-item.selected .item-icon {
    color: #f5a623;
}

.item-name {
    flex: 1;
    font-size: 0.875rem;
    color: #333;
    font-weight: 500;
}

/* Item Save Indicator */
.item-save-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    min-width: 24px;
    height: 24px;
}

.item-save-indicator .material-icons {
    font-size: 1.125rem;
    line-height: 1;
}

.item-save-indicator.saving {
    color: #999;
}

.item-save-indicator.saving .material-icons {
    animation: rotate 1s linear infinite;
}

.item-save-indicator.saved {
    color: #4caf50;
}

.item-save-indicator.saved .material-icons {
    background: #e8f5e9;
    border-radius: 50%;
    padding: 2px;
}

.item-save-indicator.error {
    color: #f44336;
}

/* Item Rating Row */
.item-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 30px;
}

.mini-star-rating {
    display: flex;
    gap: 2px;
}

.mini-star {
    cursor: pointer;
    transition: transform 0.1s;
    padding: 4px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-star:hover {
    transform: scale(1.1);
}

.mini-star .material-icons {
    font-size: 2rem;
    color: #ddd;
}

.mini-star.active .material-icons,
.mini-star:hover .material-icons {
    color: #ffc107;
}

/* Clear Rating Button */
.clear-rating-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border: none !important;
    background: #f0f0f0 !important;
    border-radius: 50% !important;
    cursor: pointer;
    color: #999;
    transition: all 0.2s;
    margin-left: 8px;
    flex-shrink: 0;
}

.clear-rating-btn:hover {
    background: #ff5252 !important;
    color: white;
}

.clear-rating-btn .material-icons {
    font-size: 1rem;
    line-height: 1;
}

/* Item Description */
.item-description {
    margin-top: 8px;
    padding-left: 30px;
}

.item-desc-input {
    font-size: 0.8125rem;
    padding: 8px 12px;
}

/* Form Actions */
.guide-form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.guide-done-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    justify-content: center;
}

.guide-done-btn .material-icons {
    font-size: 1.125rem;
}

/* Loading State */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: #f5a623;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

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

/* Mobile Responsive */
@media (max-width: 640px) {
    .guide-form-content {
        padding: 16px;
    }

    .guide-form-header {
        margin: -16px -16px 20px;
        padding: 16px;
    }

    .guide-form-title {
        font-size: 1rem;
    }

    .star-btn .material-icons {
        font-size: 1.75rem;
    }

    .category-header {
        padding: 12px 14px;
    }

    .facility-item {
        padding: 10px 14px;
    }

    .item-rating-row {
        padding-left: 0;
    }

    .item-description {
        padding-left: 0;
    }

    .guide-form-actions {
        flex-direction: column;
    }

    .guide-done-btn {
        width: 100%;
    }
}
