/* Custom styles for SnapCity */

/* Base styles */
body {
    scroll-behavior: smooth;
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

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

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

.animate-fadeOut {
    animation: fadeOut 0.5s ease-out;
}

/* Navigation styles */
.nav-container {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 40;
    position: relative;
}

.logo-container img {
    height: 40px;
    transition: transform 0.3s ease;
}

.logo-container:hover img {
    transform: scale(1.05);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #2563eb;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #2563eb;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: #2563eb;
}

#mobile-menu-button {
    position: relative;
    z-index: 45;
}

/* Mobile navigation styles */
.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #4a5568;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.mobile-nav-link:hover {
    background-color: #f7fafc;
    color: #2b6cb0;
}

.mobile-nav-link.active {
    background-color: #ebf8ff;
    color: #2b6cb0;
}

#mobile-menu-container.open {
    transform: translateX(0);
}

#mobile-menu-backdrop.open {
    display: block;
}

/* Section transitions */
.section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.section.active {
    display: block;
    opacity: 1;
}

/* Hero Section Animations */
.city-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/city-pattern.svg') repeat;
    opacity: 0.1;
    animation: slideBackground 20s linear infinite;
}

@keyframes slideBackground {
    from { background-position: 0 0; }
    to { background-position: 100% 100%; }
}

.floating-dashboard {
    position: relative;
    width: 100%;
    height: 500px;
    background: url('../assets/dashboard-preview.png') no-repeat center;
    background-size: contain;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Hero Section Styles */
.hero-section {
    padding-top: 8rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
}

.hero-section h1 {
    color: #1a1a1a;
    margin-top: 5rem;  /* Add space below navigation */
    position: relative;
    z-index: 10;
}

/* Feature Cards */
.feature-card {
    @apply bg-white p-6 rounded-xl shadow-lg hover:shadow-xl transition-shadow;
    transform: translateY(0);
    transition: transform 0.3s ease-out;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    @apply p-4 rounded-lg mb-4 inline-block;
}

/* Stats Animation */
.stat-card {
    @apply p-6 rounded-lg bg-white/10 backdrop-blur-lg;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

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

/* Animations */
.animate-fadeIn {
    animation: fadeIn 0.5s ease-out forwards;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

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

/* Chat styles */
.typing-dots {
    display: inline-block;
}

.typing-dots::after {
    content: '...';
    animation: blink 1s infinite;
}

#chatWidget {
    transition: all 0.3s ease;
}

.chat-widget {
    z-index: 1000;
}

#chat-container {
    position: absolute;
    bottom: 5rem;
    right: 0;
    width: 350px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

#chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

/* Chat widget animations */
.chat-message {
    animation: slideIn 0.3s ease-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

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

/* Custom focus styles */
input:focus, 
button:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: rgb(37, 99, 235);
}

/* Card hover effects */
.shadow-md {
    transition: all 0.3s ease;
}

.shadow-md:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Progress bar animations */
.progress-bar {
    transition: width 0.6s ease-out;
}

/* Chart animations */
.chart-container {
    transition: all 0.3s ease-out;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease-out forwards;
}

/* Responsive font sizes */
@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .nav-link {
        font-size: 0.875rem;
    }
}

/* Status badge styles */
.status-badge {
    transition: all 0.3s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

/* Form element styles */
input[type="text"],
textarea,
select {
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: rgb(37, 99, 235);
}

/* Button hover effects */
button {
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-1px);
}

/* Social feed interactions */
.social-interaction {
    transition: all 0.2s ease;
}

.social-interaction:hover {
    color: rgb(37, 99, 235);
    transform: scale(1.1);
}

/* Mission card progress bar */
.mission-progress {
    position: relative;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.mission-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgb(37, 99, 235);
    transition: width 0.5s ease-out;
}

/* Alert animations */
.alert {
    animation: slideIn 0.3s ease-out;
}

/* Footer styles */
.site-footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 3rem;
}

.footer-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 2rem;
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    color: #9ca3af;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: #ffffff;
}

/* Responsive Design */
/* Large screens (1280px and up) */
@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Medium screens (768px to 1279px) */
@media (max-width: 1279px) {
    .container {
        max-width: 90%;
        margin: 0 auto;
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Tablet screens (640px to 767px) */
@media (max-width: 767px) {
    .nav-container {
        padding: 0.5rem;
    }
    
    .nav-menu {
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        display: none;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .grid-cols-3, .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .featured-missions {
        flex-direction: column;
    }
    
    .mission-card {
        width: 100%;
        margin: 0.5rem 0;
    }
}

/* Mobile screens (up to 639px) */
@media (max-width: 639px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .button {
        width: 100%;
        text-align: center;
    }
    
    .social-feed {
        padding: 1rem;
    }
    
    .post-card {
        margin: 0.5rem 0;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        margin-top: 1rem;
    }
    
    .profile-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .stats-container {
        flex-direction: column;
    }
}

/* Handle touch devices */
@media (hover: none) {
    .hover-effect {
        display: none;
    }
    
    .touch-friendly {
        padding: 1rem;
        min-height: 44px; /* Minimum touch target size */
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card, .nav-container {
        background-color: #2d2d2d;
    }
    
    .text-gray-600 {
        color: #d1d1d1;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    body {
        background: white;
        color: black;
    }
    
    a {
        color: #0000EE;
    }
    
    .button {
        border: 2px solid black;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.5rem 0;
    }

    .logo-container img {
        height: 32px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-social {
        margin-top: 1rem;
        justify-content: center;
    }

    /* Dashboard responsive adjustments */
    .stat-card {
        margin-bottom: 1rem;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 640px) {
    .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

    .snappoints-display {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }

    .footer-section {
        padding: 1rem;
    }

    /* Dashboard mobile adjustments */
    .stat-card {
        padding: 1rem;
    }

    .chart-container {
        height: 200px;
    }
}

/* Mobile Navigation */
.mobile-menu-button {
    display: none;
}

@media (max-width: 640px) {
    .mobile-menu-button {
        display: block;
    }

    .nav-links {
        display: none;
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .nav-container {
        background-color: rgba(17, 24, 39, 0.95);
    }

    .nav-link {
        color: #e5e7eb;
    }

    .nav-link:hover {
        color: #60a5fa;
    }

    .logo-container span {
        color: #e5e7eb;
    }
}

#mobile-menu {
    z-index: 50;
}
