/* Like and Comment System Styles */

/* ===== 基礎樣式 ===== */
.like-comment-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: white;
}

.like-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.comment-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

/* ===== 管理員密碼彈窗樣式 ===== */
.admin-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.admin-password-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.7) translateY(-50px);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.admin-password-modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: #ffd700;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    color: white;
}

.modal-body p {
    margin: 0 0 15px 0;
    font-size: 16px;
    line-height: 1.6;
}

.comment-id-highlight {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.password-input-group {
    position: relative;
    margin: 20px 0;
}

.admin-password-input {
    width: 100%;
    padding: 15px 50px 15px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.admin-password-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.admin-password-input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    user-select: none;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modal-warning {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    color: #ffc107;
    font-size: 14px;
    text-align: center;
    font-weight: bold;
}

.modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    position: relative;
    overflow: hidden;
}

.cancel-btn {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    color: white;
    box-shadow: 0 4px 15px rgba(127, 140, 141, 0.3);
}

.cancel-btn:hover {
    background: linear-gradient(45deg, #7f8c8d, #95a5a6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 140, 141, 0.4);
}

.confirm-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.confirm-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #c0392b, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.confirm-btn:disabled {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(127, 140, 141, 0.2);
}

.modal-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* ===== 布局樣式 ===== */
.like-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(238, 90, 36, 0.4);
    position: relative;
    overflow: hidden;
}

.like-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.like-button.disabled {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    box-shadow: 0 3px 10px rgba(127, 140, 141, 0.3);
}

.like-count {
    font-size: 24px;
    font-weight: bold;
    margin-top: 15px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.comment-form {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-input {
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.submit-button {
    background: linear-gradient(45deg, #00b894, #00cec9);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
}

.comments-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.comment-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #ffd700;
    animation: slideInUp 0.5s ease;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-author {
    font-weight: bold;
    color: #ffd700;
    font-size: 16px;
}

.comment-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.delete-comment-btn {
    background: linear-gradient(45deg, #ff4757, #c44569);
    color: white;
    border: none;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(255, 71, 87, 0.3);
    margin-left: auto;
}

.delete-comment-btn:hover {
    background: linear-gradient(45deg, #ff3742, #b33a5c);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 71, 87, 0.4);
}

.comment-message {
    line-height: 1.6;
    margin-bottom: 10px;
}

.admin-reply {
    background: rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    border-left: 3px solid #ffd700;
}

.admin-reply-header {
    font-weight: bold;
    color: #ffd700;
    font-size: 14px;
    margin-bottom: 5px;
}

/* ===== 交互樣式 ===== */

.like-button:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(238, 90, 36, 0.6);
}

.like-button:hover:not(.disabled):before {
    left: 100%;
}

.like-button:active:not(.disabled) {
    transform: translateY(0);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 184, 148, 0.5);
}

.submit-button:active {
    transform: translateY(0);
}

.comment-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.pagination-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.pagination-btn:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.page-info {
    color: white;
    font-weight: bold;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    min-width: 80px;
    text-align: center;
}

/* Comment ID Styles */
.comment-id {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 10px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.comment-name-id {
    display: flex;
    align-items: center;
}

/* ===== 響應式樣式 ===== */
@media (max-width: 768px) {
    .like-comment-container {
        margin: 15px;
        padding: 15px;
    }
    
    .like-button {
        padding: 12px 25px;
        font-size: 16px;
    }
    
    .form-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .submit-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .like-comment-container {
        margin: 10px;
        padding: 10px;
    }
    
    .like-section,
    .comment-section {
        padding: 15px;
    }
    
    .like-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .like-count {
        font-size: 20px;
    }
}

/* 動畫效果 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.like-button.liked {
    animation: pulse 0.6s ease;
}

/* 滾動條樣式 */
.comments-list::-webkit-scrollbar {
    width: 8px;
}

.comments-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}