/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Photo Modal Styles */
.photo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.photo-modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    max-width: 80vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.photo-modal-header {
    padding: 0.75rem;
    display: flex;
    justify-content: flex-end;
    background: rgba(248, 249, 250, 0.8);
    border-bottom: 1px solid #e1e5e9;
    flex-shrink: 0;
}

.photo-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-modal-close:hover {
    background: rgba(111, 143, 201, 0.1);
    color: #6F8FC9;
}

.photo-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
    max-height: calc(85vh - 140px);
    flex-shrink: 1;
}

.photo-modal-body img {
    max-width: 80%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
}

.photo-modal-footer {
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(248, 249, 250, 0.8);
    border-top: 1px solid #e1e5e9;
    flex-shrink: 0;
}

.photo-nav-btn {
    background: linear-gradient(45deg, #E8C46B, #A9761F);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.photo-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(232, 196, 107, 0.3);
}

.photo-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#photo-counter {
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
}

/* Make carousel images clickable */
.carousel-slide {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.carousel-slide:hover {
    transform: scale(1.02);
}

.carousel-slide img {
    transition: filter 0.3s ease;
}

.carousel-slide:hover img {
    filter: brightness(1.1);
}

/* Feature Register Link */
.feature-register-link {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding: 0 20px;
    animation: fadeInUp 1.4s ease;
}

/* Homepage Register Form Styles */
.homepage-register-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 0 20px;
    scroll-margin-top: 96px; /* 滾動偏移，避免被固定導航欄遮擋 */
}

.homepage-register-card {
    background: linear-gradient(160deg, rgba(255, 253, 246, 0.96), rgba(244, 232, 193, 0.9));
    border-radius: 22px;
    padding: 2.25rem 2.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(229, 184, 66, 0.45);
    position: relative;
    box-shadow:
        0 16px 40px rgba(45, 31, 23, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

/* 外框發光特效 */
.homepage-register-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg,
        rgba(229, 184, 66, 0.55) 0%,
        rgba(59, 89, 152, 0.35) 45%,
        rgba(197, 146, 42, 0.55) 100%);
    border-radius: 24px;
    z-index: -1;
    opacity: 0.55;
    animation: borderGlow 3s ease infinite;
    filter: blur(10px);
}

/* 外框動畫 */
@keyframes borderGlow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.01);
    }
}

/* 懸停效果 */
.homepage-register-card:hover {
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.homepage-register-card:hover::before {
    opacity: 0.8;
    filter: blur(10px);
}

/* 註冊區塊：左側特色說明 + 右側表單的雙欄排版 */
.homepage-register-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 2.5rem;
    align-items: center;
}

.homepage-register-benefits {
    padding-right: 2rem;
    border-right: 1px solid rgba(45, 31, 23, 0.15);
}

.homepage-register-badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #F3D978, #C4922A);
    color: #2D1F17;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(196, 146, 42, 0.35);
}

.homepage-register-benefits-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #2D1F17;
    line-height: 1.35;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
}

.homepage-register-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.homepage-register-benefits-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #34495e;
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

.homepage-register-benefits-list i {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(196, 146, 42, 0.18), rgba(196, 146, 42, 0.08));
    color: #C4922A;
    font-size: 1rem;
}

.homepage-register-header {
    text-align: center;
    margin-bottom: 2rem;
}

.homepage-register-title {
    color: #2D1F17;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
}

.homepage-register-title i {
    color: #C4922A;
    margin-right: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(196, 146, 42, 0.3));
}

.homepage-register-subtitle {
    color: #34495e;
    font-size: 0.95rem;
    margin: 0;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.homepage-register-form {
    margin-bottom: 1.5rem;
}

.homepage-form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.homepage-form-group {
    margin-bottom: 0;
}

.homepage-form-checkbox-group {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.homepage-form-label {
    display: block;
    color: #2D1F17;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.homepage-form-label i {
    color: #6F8FC9;
    margin-right: 0.5rem;
    width: 16px;
    filter: drop-shadow(0 1px 2px rgba(111, 143, 201, 0.3));
}

.homepage-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
    color: #333;
}

.homepage-form-input::placeholder {
    color: rgba(102, 102, 102, 0.7);
}

.homepage-form-input:focus {
    outline: none;
    border-color: rgba(111, 143, 201, 0.6);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 0 0 3px rgba(111, 143, 201, 0.15),
        0 4px 12px rgba(111, 143, 201, 0.1);
}

.homepage-form-input.error {
    border-color: #B3452F;
}

.homepage-form-help {
    font-size: 0.75rem;
    color: #5a6c7d;
    margin-top: 0.25rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

.homepage-form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.homepage-form-checkbox input[type="checkbox"] {
    margin-top: 0.2rem;
    cursor: pointer;
}

.homepage-form-checkbox label {
    font-size: 0.85rem;
    color: #34495e;
    cursor: pointer;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

.homepage-auth-btn {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(243, 217, 120, 0.95), rgba(196, 146, 42, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #2D1F17;
    border: 2px solid rgba(138, 100, 24, 0.6);
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(196, 146, 42, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

.homepage-auth-btn::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 ease;
}

.homepage-auth-btn:hover::before {
    left: 100%;
}

.homepage-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(196, 146, 42, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    border-color: rgba(138, 100, 24, 0.8);
}

.homepage-auth-btn:active {
    transform: translateY(1px);
    filter: brightness(0.94);
}

.homepage-auth-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.homepage-auth-btn i {
    margin-right: 0.5rem;
}

.homepage-auth-footer {
    text-align: center;
    color: #34495e;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

/* 已登入會員顯示區域 */
.homepage-member-info {
    margin-top: 2rem;
}

.homepage-member-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.homepage-member-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(111, 143, 201, 0.3), rgba(59, 89, 152, 0.3));
    border-radius: 50%;
    border: 3px solid rgba(111, 143, 201, 0.5);
}

.homepage-member-icon i {
    font-size: 3rem;
    color: #6F8FC9;
    filter: drop-shadow(0 2px 4px rgba(111, 143, 201, 0.3));
}

.homepage-member-details {
    flex: 1;
}

.homepage-member-username {
    color: #2D1F17;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.homepage-member-username strong {
    color: #6F8FC9;
    font-weight: 700;
}

.homepage-member-actions {
    display: flex;
    gap: 1rem;
}

.homepage-member-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(111, 143, 201, 0.9), rgba(59, 89, 152, 0.9));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(111, 143, 201, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.homepage-member-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(111, 143, 201, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    text-decoration: none;
}

.homepage-member-btn i {
    font-size: 1.1rem;
}

.homepage-link {
    color: #6F8FC9;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.homepage-link:hover {
    color: #3B5998;
    text-decoration: underline;
}

/* Loading */
.homepage-auth-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    z-index: 10;
}

.homepage-register-card {
    position: relative;
}

.homepage-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(111, 143, 201, 0.3);
    border-top: 3px solid #6F8FC9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* Alert Messages */
.homepage-alert-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1000;
}

.homepage-alert {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.homepage-alert.success {
    border-left-color: #3F7D4A;
    color: #3F7D4A;
}

.homepage-alert.error {
    border-left-color: #B3452F;
    color: #B3452F;
}

.homepage-alert i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Discord Modal Styles */
.homepage-discord-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.homepage-discord-modal-content {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.homepage-discord-modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.homepage-discord-modal-header i {
    font-size: 3rem;
    color: #5865f2;
    margin-bottom: 1rem;
    display: block;
}

.homepage-discord-modal-header h3 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.homepage-discord-modal-body {
    text-align: center;
    margin-bottom: 2rem;
}

.homepage-discord-modal-body p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.homepage-discord-benefits {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 15px;
}

.homepage-benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #555;
    font-size: 0.95rem;
}

.homepage-benefit-item i {
    color: #5865f2;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.homepage-discord-modal-footer {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

.homepage-discord-btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.homepage-discord-btn.homepage-join-discord {
    background: #5865f2;
    color: white;
}

.homepage-discord-btn.homepage-join-discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(88, 101, 242, 0.3);
}

.homepage-discord-btn.homepage-skip-discord {
    background: #e9ecef;
    color: #666;
}

.homepage-discord-btn.homepage-skip-discord:hover {
    background: #dee2e6;
    color: #495057;
}

.feature-register-link a {
    display: inline-block;
    transition: transform 0.3s ease;
}

.feature-register-link:hover a {
    transform: translateY(-5px) rotate(3deg);
}

.feature-register-link img {
    filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.2));
    max-width: 100%;
    height: auto;
}

.feature-register-link:hover img {
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.35));
}

/* Responsive Design */
@media (max-width: 768px) {
    .photo-modal-overlay {
        padding: 0.25rem;
    }
    
    .photo-modal-content {
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .photo-modal-header {
        padding: 0.5rem;
    }
    
    .photo-modal-close {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .photo-modal-body {
        padding: 0.5rem;
        max-height: calc(90vh - 120px);
    }
    
    .photo-modal-footer {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .photo-nav-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    #photo-counter {
        font-size: 0.75rem;
        min-width: 45px;
    }
    
    .feature-register-link {
        margin-top: 1.5rem;
    }
    
    .feature-register-link img {
        max-width: 360px;
    }
    
    /* Homepage Register Form Responsive */
    .homepage-register-container {
        margin-top: 2rem;
        padding: 0 15px;
        scroll-margin-top: 100px;
    }
    
    .homepage-register-card {
        padding: 2rem 1.5rem;
    }

    .homepage-register-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .homepage-register-benefits {
        padding-right: 0;
        padding-bottom: 1.5rem;
        border-right: none;
        border-bottom: 1px solid rgba(45, 31, 23, 0.15);
        text-align: center;
    }

    .homepage-register-benefits-list {
        text-align: left;
    }
    
    .homepage-form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .homepage-register-title {
        font-size: 1.5rem;
    }
    
    .homepage-alert-container {
        top: 80px;
        right: 10px;
        left: 10px;
    }
    
    .homepage-alert {
        min-width: auto;
        width: 100%;
    }
    
    .homepage-discord-modal-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
        max-width: 90%;
    }
    
    .homepage-discord-modal-header h3 {
        font-size: 1.5rem;
    }
    
    .homepage-discord-modal-header i {
        font-size: 2.5rem;
    }
    
    .homepage-discord-benefits {
        padding: 1rem;
    }
    
    .homepage-discord-modal-footer {
        gap: 0.75rem;
    }
    
    /* 已登入會員顯示區域 - 手機版 */
    .homepage-member-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .homepage-member-icon {
        width: 60px;
        height: 60px;
    }
    
    .homepage-member-icon i {
        font-size: 2.5rem;
    }
    
    .homepage-member-username {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .homepage-member-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .homepage-member-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}
