/* Base Variables */
:root {
    --primary-color: #008B9A; /* Deep Teal */
    --secondary-color: #00A7B5; /* Light Aqua */
    --background-color: #00CFC1; /* Bright Aqua Blue */
    --text-color: #002B36; /* Deep Navy */
    --accent-color: #FFFFFF; /* White */
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

/* Typography */
body {
    font-family: 'Lato', sans-serif;
    color: var(--text-color);
    background-color: #f5f9fa;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Layout Components */
.app-header {
    background-color: var(--accent-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

.app-footer {
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 1rem 0;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Carousel */
.swiper-container {
    width: 100%;
    height: 300px;
    margin-bottom: 2rem;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
}

/* Form Elements */
.form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 139, 154, 0.25);
}

/* Custom Checkboxes */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .swiper-container {
        height: 200px;
    }
}

/* Mobile Bottom Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--accent-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.mobile-nav-item span {
    font-size: 0.75rem;
}

.mobile-nav-item:hover, .mobile-nav-item:active {
    color: var(--primary-color);
}

/* Adjust main content padding to account for mobile nav */
@media (max-width: 768px) {
    .app-content {
        padding-bottom: 70px;
    }
}

/* Mobile-Specific Optimizations */

/* Base Mobile Adjustments */
@media (max-width: 768px) {
    body {
        font-size: 0.95rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Mobile Bottom Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--accent-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.mobile-nav-item span {
    font-size: 0.75rem;
}

.mobile-nav-item:hover, .mobile-nav-item:active {
    color: var(--primary-color);
}

/* Adjust main content padding to account for mobile nav */
@media (max-width: 768px) {
    .app-content {
        padding-bottom: 70px;
    }
    
    .app-footer {
        padding-bottom: 80px;
    }
}

/* Animation and Micro-interaction Styles */

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Card Hover Animation */
.card-hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

/* Form Animations */
.form-control {
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-focused {
    position: relative;
}

.input-focused::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.input-focused.focused::after {
    transform: scaleX(1);
}

.form-floating.filled label {
    opacity: 0.65;
}

.form-floating.focused label {
    color: var(--primary-color);
}

/* Shake animation for invalid inputs */
.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-3px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(3px, 0, 0);
    }
}

/* Page Transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.back-to-top.active {
    opacity: 1;
    transform: translateY(0);
}

/* Image Loading States */
.lazy-image {
    transition: opacity 0.3s, filter 0.3s;
}

.image-loading {
    opacity: 0.5;
    filter: blur(5px);
}

.image-loaded {
    opacity: 1;
    filter: blur(0);
}

/* Skeleton Loader */
.skeleton {
    background: #eee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: 5px;
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    border-radius: 8px;
    overflow: hidden;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* Pulse Animation for CTA buttons */
.btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 139, 154, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 139, 154, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 139, 154, 0);
    }
}

/* Transition for Collapsible Sections */
.collapsible-section {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}

/* Hide top back button on login/auth pages */
.auth-page .back-to-home,
.login-container .back-button,
.back-to-home {
    display: none !important;
}
