﻿/* Custom CSS for GoToUrl Platform */

/* GoToUrl Platform Styles */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --info-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --dark-gradient: linear-gradient(135deg, #4c4c4c 0%, #2c2c2c 100%);
}

/* Background */
.bg-gradient {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 50%, #6c5ce7 100%);
    min-height: 100vh;
}

/* Gradient Text */
.text-gradient-primary {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Logo Icon */
.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
}

/* Backdrop Blur Effect */
.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Custom Buttons */
.btn-gradient-primary {
    background: var(--primary-gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    color: white;
}

.btn-gradient-blue {
    background: var(--success-gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
    transition: all 0.3s ease;
}

.btn-gradient-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.6);
    color: white;
}

.btn-gradient-purple {
    background: var(--secondary-gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
    transition: all 0.3s ease;
}

.btn-gradient-purple:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.6);
    color: white;
}

/* Navigation Pills */
.nav-pills .nav-link {
    border-radius: 15px;
    margin: 0 5px;
    transition: all 0.3s ease;
    background: transparent;
    border: 2px solid transparent;
}

.nav-pills .nav-link:hover {
    background: rgba(116, 185, 255, 0.1);
    border-color: rgba(116, 185, 255, 0.3);
}

.nav-pills .nav-link.active {
    background: var(--primary-gradient);
    color: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Upload Area Styles - 新的上傳區域樣式 */
.upload-container {
    position: relative;
}

.upload-area {
    border: 3px dashed #ddd;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

/* Upload Prompt - 整個區域可點擊 */
.upload-prompt {
    transition: all 0.3s ease;
    user-select: none;
    cursor: pointer !important;
}

.upload-prompt:hover {
    color: #667eea;
    transform: translateY(-2px);
}

.upload-prompt:hover i {
    color: #667eea !important;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.upload-prompt:hover .btn {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.upload-prompt:active {
    transform: translateY(0px);
}

.file-selected {
    transition: opacity 0.3s ease;
}

.upload-area .btn {
    transition: all 0.3s ease;
}

.upload-area .btn:hover {
    transform: translateY(-1px);
}

/* File Type Icons */
.upload-area i[class*="bi-image"] {
    color: #28a745 !important;
}

.upload-area i[class*="bi-camera-video"] {
    color: #007bff !important;
}

.upload-area i[class*="bi-file"] {
    color: #6c757d !important;
}

/* Form Controls */
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Card Enhancements */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* Border Dashed */
.border-dashed {
    border: 2px dashed #dee2e6 !important;
    border-radius: 10px;
}

/* Height Utilities */
.h-400 {
    height: 400px;
}

/* Character Warning */
.char-warning {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

/* Cursor Pointer Utility */
.cursor-pointer {
    cursor: pointer !important;
}

/* Loading States - 改善的載入狀態樣式 */
.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading:hover {
    transform: none;
    box-shadow: none;
}

/* Bootstrap Spinner 改善 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.1em;
}

/* 禁用按鈕樣式 */
.btn:disabled {
    opacity: 0.65;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 載入狀態的按鈕特殊樣式 */
.btn-gradient-blue.loading {
    background: var(--success-gradient);
    opacity: 0.8;
}

.btn-gradient-purple.loading {
    background: var(--secondary-gradient);
    opacity: 0.8;
}

.btn-danger.loading {
    background: #dc3545;
    opacity: 0.8;
}

/* Toast Styles */
.toast {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-success {
    background: var(--info-gradient);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.toast-warning {
    background: var(--warning-gradient);
    color: white;
}

.toast-info {
    background: var(--success-gradient);
    color: white;
}

.toast .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Description Content Styles - 新增說明內容樣式 */
.description-content {
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
}

.description-content a {
    word-break: break-all;
    transition: all 0.2s ease;
}

.description-content a:hover {
    color: #0056b3 !important;
    text-decoration: underline !important;
}

/* 確保連結在小螢幕上也能正確換行 */
@media (max-width: 768px) {
    .description-content {
        font-size: 0.9rem;
    }
    
    .description-content a {
        word-break: break-all;
        display: inline-block;
        max-width: 100%;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 表單提交狀態指示 */
.form-submitting {
    position: relative;
}

.form-submitting::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    border-radius: inherit;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-pills .nav-link span {
        display: none;
    }
    
    .upload-area {
        padding: 2rem 1rem !important;
    }
    
    .upload-prompt h5 {
        font-size: 1.1rem;
    }
    
    .upload-prompt p {
        font-size: 0.9rem;
    }
    
    .upload-prompt:hover {
        transform: none; /* 在行動裝置上禁用 hover 變換 */
    }
    
    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .display-6 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* 行動裝置上的按鈕優化 */
    .btn.loading {
        min-height: 2.5rem;
    }
    
    .spinner-border-sm {
        width: 0.8rem;
        height: 0.8rem;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .upload-area {
        background: rgba(255, 255, 255, 0.03);
        border-color: #444;
    }
    
    .upload-area:hover {
        background: rgba(102, 126, 234, 0.1);
    }
    
    .upload-prompt:hover {
        color: #74b9ff;
    }
    
    .description-content {
        color: #e9ecef;
    }
    
    .description-content a {
        color: #74b9ff !important;
    }
    
    .description-content a:hover {
        color: #0084ff !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Focus Styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
}

/* File Selection State Improvements */
.file-selected .bg-light {
    background: rgba(248, 249, 250, 0.8) !important;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.file-selected .btn-outline-danger:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* 改善點擊回饋 */
.upload-prompt:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 無障礙支援 */
.upload-prompt[role="button"] {
    cursor: pointer;
}

/* 減少動畫效果（對於偏好減少動作的使用者） */
@media (prefers-reduced-motion: reduce) {
    .upload-prompt:hover,
    .upload-prompt:hover i,
    .upload-prompt:hover .btn,
    .btn,
    .card {
        transform: none;
        transition: none;
    }
    
    .spinner-border {
        animation: none;
    }
    
    .pulse {
        animation: none;
    }
    
    .description-content a {
        transition: none;
    }
}

/* 提交狀態的視覺改善 */
.btn-submitting {
    background: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.1) 50%, transparent 50%, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
    animation: loading-stripe 1s linear infinite;
}

@keyframes loading-stripe {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

/* Language Switcher Styles - Simple Select Version */
.language-switcher .form-select {
    border-radius: 20px !important;
    font-size: 0.9rem;
    padding: 0.4rem 2rem 0.4rem 0.8rem;
    min-width: 150px;
    border: 1px solid #dee2e6;
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    cursor: pointer;
}

.language-switcher .form-select:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.language-switcher .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.language-switcher .form-label {
    font-size: 0.85rem;
    color: #6c757d;
    white-space: nowrap;
}

/* Mobile optimization for language switcher */
@media (max-width: 768px) {
    .language-switcher .form-select {
        min-width: 120px;
        font-size: 0.8rem;
        padding: 0.3rem 1.5rem 0.3rem 0.6rem;
    }
    
    .language-switcher .form-label {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .language-switcher .form-select {
        min-width: 100px;
        font-size: 0.75rem;
    }
}

/* Remove the old complex dropdown styles */
.dropdown-toggle {
    border-radius: 20px !important;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    min-width: 200px;
}

.dropdown-item {
    padding: 0.7rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    transform: translateX(5px);
}

.dropdown-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dropdown-item.active:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    color: white;
    transform: none;
}

.dropdown-header {
    color: #667eea;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-divider {
    margin: 0.3rem 0;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

/* Footer Hover Effects */
.hover-primary:hover {
    color: #667eea !important;
    transition: all 0.2s ease;
}

.hover-primary {
    transition: all 0.2s ease;
}

/* Badge Styles */
.badge.bg-primary {
    background: var(--primary-gradient) !important;
    border: none;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
}

/* Responsive Language Switcher */
@media (max-width: 768px) {
    .dropdown-toggle {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .dropdown-menu {
        min-width: 180px;
        font-size: 0.85rem;
    }
    
    .dropdown-item {
        padding: 0.6rem 0.8rem;
    }
}
