/* Нэмэлт CSS загварууд */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-attachment: fixed;
}

/* Modern gradient text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glassmorphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Animated gradient border */
@keyframes gradient-border {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-border {
    position: relative;
    background: linear-gradient(60deg, #667eea, #764ba2, #f093fb, #4facfe);
    background-size: 300% 300%;
    animation: gradient-border 5s ease infinite;
    padding: 2px;
    border-radius: 1rem;
}

.animated-border > * {
    background: #1F2937;
    border-radius: calc(1rem - 2px);
}

/* Чатботын мессежний загвар */
.message {
    padding: 10px 14px;
    max-width: 80%;
    word-wrap: break-word;
}
#chatbot-messages {
    display: flex;
    flex-direction: column;
}
.message.user {
    background-color: #374151; /* Dark Gray */
    color: #fff;
    align-self: flex-end;
    border-radius: 12px 12px 0 12px;
}
.message.bot {
    background-color: #E5E7EB; /* Light Gray */
    color: #1F2937;
    align-self: flex-start;
    border-radius: 12px 12px 12px 0;
}

/* Чатбот нээх/хаах анимац */
#chatbot-container.closed {
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
#chatbot-container.open {
    transform: scale(1);
    opacity: 1;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* project.html-аас зөөсөн загварууд */
.monochrome-img {
    filter: grayscale(100%) contrast(1.1);
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.monochrome-img:hover {
    filter: grayscale(0%) contrast(1);
    transform: scale(1.02);
}

.back-button {
    background-color: #374151; /* gray-700 */
    color: #F9FAFB; /* gray-50 */
    padding: 12px 24px;
    border-radius: 9999px; /* fully rounded */
    font-weight: 600;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.back-button:hover {
    background-color: #4B5563; /* gray-600 */
    transform: translateY(-2px);
}

/* Mobile chatbot positioning - жижиг дэлгэцэнд илүү сайн харагдана */
@media (max-width: 640px) {
    #chatbot-container {
        width: 90vw !important;
        max-width: 350px;
        height: 70vh !important;
        max-height: 500px;
        bottom: 1rem !important;
        right: 1rem !important;
    }

    #chatbot-open-btn {
        bottom: 1rem !important;
        right: 1rem !important;
        padding: 0.75rem !important;
    }

    .message {
        max-width: 85%;
        font-size: 0.9rem;
    }
}

/* Chatbot fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: fadeIn 0.3s ease-out;
}

/* Enhanced chatbot styling */
#chatbot-container {
    background: rgba(31, 41, 55, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
}

#chatbot-open-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    transition: all 0.3s ease;
}

#chatbot-open-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.7);
}

.chatbot-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8)) !important;
}

/* Smooth button transitions */
button {
    transition: all 0.2s ease-in-out;
}

/* Enhanced section styling */
section {
    position: relative;
    overflow: hidden;
}

section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 0.5;
    }
}

/* Enhanced card hover effects */
.project-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.6) 0%, rgba(31, 41, 55, 0.8) 100%);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
    transition: left 0.5s;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5) !important;
}

/* Skill card animations */
.skill-card {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(102, 126, 234, 0.1), transparent 30%);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

/* Enhanced buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Floating animation for profile image */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.profile-img {
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    border: 4px solid rgba(102, 126, 234, 0.3) !important;
}

/* Shimmer effect for headings */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer-text {
    background: linear-gradient(90deg, #ffffff 0%, #667eea 50%, #ffffff 100%);
    background-size: 1000px 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* Enhanced header */
header {
    background: rgba(31, 41, 55, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

/* Link hover effects */
a {
    position: relative;
    transition: all 0.3s ease;
}

.menu-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.menu-item:hover::after {
    width: 100%;
}

/* Form input enhancements */
input:focus, textarea:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

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

::-webkit-scrollbar-track {
    background: #1F2937;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}