/* TalkLove.app - Custom Styles */

:root {
    --primary-color: #ff4b6e;
    --primary-dark: #e63956;
    --primary-light: #ff7b94;
    --secondary-color: #6c5ce7;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --danger-color: #d63031;
    --dark-color: #2d3436;
    --light-color: #f8f9fa;
    --gradient-primary: linear-gradient(135deg, #ff4b6e 0%, #ff7b94 100%);
    --gradient-secondary: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f6fa;
    color: var(--dark-color);
    line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--gradient-primary);
    color: white;
    z-index: 9999;
}

/* Navbar */
.navbar-talklove {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1rem;
}

.navbar-talklove .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.navbar-talklove .navbar-brand i {
    margin-right: 0.5rem;
}

.navbar-talklove .nav-link {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.navbar-talklove .nav-link:hover,
.navbar-talklove .nav-link.active {
    color: var(--primary-color);
}

.navbar-talklove .nav-link i {
    font-size: 1.2rem;
}

/* Buttons */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: var(--gradient-secondary);
    border: none;
    border-radius: var(--border-radius);
}

.btn-like {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    transition: var(--transition);
}

.btn-like:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
}

.btn-dislike {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    transition: var(--transition);
}

.btn-dislike:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(214, 48, 49, 0.4);
}

.btn-superlike {
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    transition: var(--transition);
}

.btn-superlike:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* User Card */
.user-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-md);
}

.user-card-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.user-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.user-card-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.user-card-info {
    font-size: 0.9rem;
    opacity: 0.9;
}

.user-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-online {
    background: var(--success-color);
    color: white;
}

.badge-vip {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    color: white;
}

/* Matching Card */
.matching-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem;
}

.matching-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 550px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    cursor: grab;
    transition: transform 0.3s ease;
}

.matching-card:active {
    cursor: grabbing;
}

.matching-card.swiping-left {
    transform: translateX(-100px) rotate(-10deg);
    opacity: 0;
}

.matching-card.swiping-right {
    transform: translateX(100px) rotate(10deg);
    opacity: 0;
}

.matching-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.matching-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
}

.matching-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Match Animation */
.match-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.match-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    animation: bounceIn 0.5s ease;
}

.match-profiles {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.match-profile {
    text-align: center;
    animation: slideIn 0.5s ease;
}

.match-profile img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    object-fit: cover;
}

/* Chat */
.chat-container {
    display: flex;
    height: calc(100vh - 120px);
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.chat-sidebar {
    width: 320px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: var(--transition);
}

.chat-item:hover,
.chat-item.active {
    background: #f8f9fa;
}

.chat-item-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.chat-item-message {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 0.75rem;
    color: #999;
}

.chat-item-unread {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    display: flex;
    margin-bottom: 1rem;
    animation: slideUp 0.3s ease;
}

.message.sent {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 0.5rem;
}

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
}

.message.received .message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
}

.message.sent .message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 0.75rem 1.25rem;
    outline: none;
    transition: var(--transition);
}

.chat-input input:focus {
    border-color: var(--primary-color);
}

.chat-input-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
}

.chat-input-btn:hover {
    background: var(--primary-color);
    color: white;
}

.chat-input-btn.send {
    background: var(--primary-color);
    color: white;
}

/* Video Call */
.video-call-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.video-main {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-remote {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-local {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 150px;
    height: 200px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-local video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.video-control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.video-control-btn.mute {
    background: rgba(255,255,255,0.2);
    color: white;
}

.video-control-btn.mute.active {
    background: var(--danger-color);
}

.video-control-btn.end {
    background: var(--danger-color);
    color: white;
}

.video-control-btn.end:hover {
    transform: scale(1.1);
}

.video-caller-info {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
}

.video-timer {
    font-size: 1.25rem;
    margin-top: 0.5rem;
}

/* Feed / Posts */
.post-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.post-author {
    font-weight: 600;
}

.post-time {
    font-size: 0.8rem;
    color: #999;
}

.post-content {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.post-images img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
}

.post-actions {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
}

.post-action:hover {
    color: var(--primary-color);
}

.post-action.liked {
    color: var(--primary-color);
}

/* Live */
.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.live-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
}

.live-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.live-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--danger-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.live-viewers {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.live-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

/* VIP */
.vip-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.vip-card.popular {
    border: 2px solid var(--primary-color);
}

.vip-card.popular::before {
    content: '最受歡迎';
    position: absolute;
    top: 15px;
    right: -30px;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 2rem;
    font-size: 0.75rem;
    transform: rotate(45deg);
}

.vip-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--warning-color);
}

.vip-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.vip-price span {
    font-size: 1rem;
    color: #666;
}

.vip-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.vip-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.vip-features li:last-child {
    border-bottom: none;
}

/* Gifts */
.gift-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.gift-item {
    text-align: center;
    padding: 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.gift-item:hover {
    background: #f8f9fa;
}

.gift-item.selected {
    border-color: var(--primary-color);
    background: #fff5f7;
}

.gift-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.gift-name {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.gift-price {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Profile */
.profile-header {
    background: var(--gradient-primary);
    padding: 3rem 0;
    color: white;
    text-align: center;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    margin-bottom: 1rem;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 1.5rem;
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 75, 110, 0.1);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--gradient-primary);
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo i {
    font-size: 3rem;
    color: var(--primary-color);
}

.auth-logo h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-sidebar {
        display: none;
    }

    .chat-sidebar.active {
        display: flex;
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
        background: white;
    }

    .matching-card {
        max-width: 100%;
        height: 450px;
    }

    .gift-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .video-local {
        width: 100px;
        height: 140px;
    }
}

@media (max-width: 576px) {
    .profile-stats {
        gap: 1.5rem;
    }

    .auth-card {
        padding: 2rem;
    }

    .gift-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background: var(--primary-color) !important; }
.bg-gradient-primary { background: var(--gradient-primary) !important; }

/* Online Status Indicator */
.online-indicator {
    width: 12px;
    height: 12px;
    background: var(--success-color);
    border-radius: 50%;
    border: 2px solid white;
    position: absolute;
    bottom: 2px;
    right: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Badge Notifications */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 0.25rem;
}

.tag.active {
    background: var(--primary-color);
    color: white;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}
