/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

/* CSS Variables */
:root {
    --primary-blue: #2563eb;
    --primary-purple: #7c3aed;
    --secondary-blue: #3b82f6;
    --secondary-purple: #8b5cf6;
    --accent-yellow: #f59e0b;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --accent-orange: #f97316;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--gray-700);
    overflow-x: hidden;
}

.font-poppins {
    font-family: 'Poppins', sans-serif;
}

.font-inter {
    font-family: 'Inter', sans-serif;
}

/* Container responsive */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
        padding: 0 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-fade-in {
    animation: fade-in 0.8s ease-out forwards;
}

.animate-slide-up {
    animation: slide-up 0.8s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Gradient Text */
.bg-gradient-to-r.from-blue-600.to-purple-600.bg-clip-text.text-transparent {
    background: linear-gradient(to right, var(--primary-blue), var(--primary-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Line Clamp Utility */
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Modal Styles */
.modal-overlay {
    backdrop-filter: blur(8px);
}

/* Button Hover Effects */
.hover\:scale-105:hover {
    transform: scale(1.05);
}

.hover\:scale-110:hover {
    transform: scale(1.1);
}

/* Focus States */
.focus\:outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.focus\:ring-blue-500:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Transition Classes */
.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-shadow {
    transition-property: box-shadow;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.duration-300 {
    transition-duration: 300ms;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Backdrop Blur */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
}

/* Custom Shadows */
.shadow-custom {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.shadow-custom-lg {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ADMIN PANEL MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    /* Admin header mobile */
    .admin-header nav {
        padding: 0 1rem;
    }
    
    .admin-header .flex {
        flex-wrap: wrap;
    }
    
    .admin-header .hidden.md\:flex {
        display: none !important;
    }
    
    /* Show mobile menu button for admin */
    .admin-mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
    }
    
    /* Admin mobile navigation */
    .admin-mobile-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--gray-200);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        z-index: 50;
        padding: 1rem;
    }
    
    .admin-mobile-nav.hidden {
        display: none;
    }
    
    .admin-mobile-nav nav {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-mobile-nav a {
        padding: 0.75rem;
        border-radius: 0.5rem;
        text-decoration: none;
        color: var(--gray-700);
        transition: background-color 0.2s ease;
    }
    
    .admin-mobile-nav a:hover {
        background-color: var(--gray-100);
    }
    
    /* Admin user info mobile */
    .admin-user-info {
        width: 100%;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--gray-200);
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .admin-user-info .flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Admin dashboard cards mobile */
    .admin-dashboard .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Admin forms mobile */
    .admin-form {
        padding: 1rem;
    }
    
    .admin-form .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .admin-form input,
    .admin-form textarea,
    .admin-form select {
        width: 100%;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Admin tables mobile */
    .admin-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table {
        min-width: 600px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.5rem !important;
        font-size: 0.875rem;
    }
    
    /* Admin buttons mobile */
    .admin-btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px;
    }
    
    .admin-btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .admin-btn-group .admin-btn {
        margin: 0;
    }
    
    /* Admin cards mobile */
    .admin-card {
        margin: 0.5rem;
        padding: 1rem;
        border-radius: 0.5rem;
    }
    
    .admin-card h3 {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }
    
    /* Admin sidebar mobile (if exists) */
    .admin-sidebar {
        display: none;
    }
    
    .admin-main-content {
        margin-left: 0 !important;
        padding: 1rem;
    }
    
    /* Admin stats grid mobile */
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
    
    .admin-stat-card {
        padding: 1rem;
        text-align: center;
    }
    
    .admin-stat-card .stat-number {
        font-size: 1.5rem;
        font-weight: bold;
        color: var(--primary-blue);
        margin-bottom: 0.25rem;
    }
    
    .admin-stat-card .stat-label {
        font-size: 0.75rem;
        color: var(--gray-600);
    }
    
    /* Admin page titles mobile */
    .admin-page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .admin-page-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0;
    }
    
    /* Admin modal mobile */
    .admin-modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    .admin-modal .modal-content {
        padding: 1rem;
    }
    
    /* Admin messages mobile */
    .admin-message {
        margin: 0.5rem;
        padding: 0.75rem;
        border-radius: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Admin search and filters mobile */
    .admin-search-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .admin-search-input {
        width: 100%;
        padding: 0.75rem;
        font-size: 16px;
        border: 1px solid var(--gray-300);
        border-radius: 0.5rem;
    }
    
    .admin-filter-select {
        width: 100%;
        padding: 0.75rem;
        font-size: 16px;
        border: 1px solid var(--gray-300);
        border-radius: 0.5rem;
    }
}

/* Extra small devices for admin */
@media (max-width: 480px) {
    .admin-stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .admin-page-header h1 {
        font-size: 1.25rem;
    }
    
    .admin-card {
        margin: 0.25rem;
        padding: 0.75rem;
    }
    
    .admin-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.375rem !important;
        font-size: 0.75rem;
    }
}

/* Tablet specific admin styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .admin-dashboard .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .admin-stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .admin-form .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* RESPONSIVE DESIGN - Mobile First */

/* Extra Small devices (phones, 320px and up) */
@media (max-width: 374px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .text-5xl {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .text-7xl {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    .text-4xl {
        font-size: 1.75rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
    
    .text-xl {
        font-size: 1rem;
    }
    
    /* Button adjustments */
    .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* Small devices (phones, 375px and up) */
@media (max-width: 639px) {
    .text-5xl {
        font-size: 2.25rem;
        line-height: 1.2;
    }
    
    .text-7xl {
        font-size: 3rem;
        line-height: 1.1;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-2xl {
        font-size: 1.375rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
    
    /* Grid adjustments */
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    /* Spacing adjustments */
    .space-x-6 > :not([hidden]) ~ :not([hidden]) {
        --tw-space-x-reverse: 0;
        margin-right: calc(1rem * var(--tw-space-x-reverse));
        margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
    }
    
    .space-x-8 > :not([hidden]) ~ :not([hidden]) {
        --tw-space-x-reverse: 0;
        margin-right: calc(1.25rem * var(--tw-space-x-reverse));
        margin-left: calc(1.25rem * calc(1 - var(--tw-space-x-reverse)));
    }
    
    /* Padding adjustments */
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .p-6 {
        padding: 1rem;
    }
    
    /* Margin adjustments */
    .mb-12 {
        margin-bottom: 2rem;
    }
    
    .mb-8 {
        margin-bottom: 1.5rem;
    }
    
    .mb-6 {
        margin-bottom: 1rem;
    }
    
    /* Header mobile adjustments */
    .h-16 {
        height: 3.5rem;
    }
    
    /* Hero section mobile */
    .min-h-screen {
        min-height: calc(100vh - 3.5rem);
    }
    
    /* Background decorations - hide on mobile */
    .absolute.top-20,
    .absolute.top-40,
    .absolute.bottom-40,
    .absolute.bottom-20 {
        display: none;
    }
    
    /* App cards mobile */
    .rounded-2xl {
        border-radius: 1rem;
    }
    
    .shadow-lg {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }
    
    /* Button full width on mobile */
    .w-full.sm\:w-auto {
        width: 100%;
    }
    
    /* Typography mobile */
    .leading-tight {
        line-height: 1.25;
    }
    
    .leading-relaxed {
        line-height: 1.625;
    }
    
    /* Navigation mobile menu */
    .hidden.md\:flex {
        display: none;
    }
    
    .md\:hidden {
        display: block;
    }
}

/* Medium devices (tablets, 640px and up) */
@media (min-width: 640px) {
    .sm\:flex-row {
        flex-direction: row;
    }
    
    .sm\:space-y-0 > :not([hidden]) ~ :not([hidden]) {
        --tw-space-y-reverse: 0;
        margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
        margin-bottom: calc(0px * var(--tw-space-y-reverse));
    }
    
    .sm\:space-x-6 > :not([hidden]) ~ :not([hidden]) {
        --tw-space-x-reverse: 0;
        margin-right: calc(1.5rem * var(--tw-space-x-reverse));
        margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
    }
    
    .sm\:w-auto {
        width: auto;
    }
}

/* Large devices (desktops, 768px and up) */
@media (min-width: 768px) {
    .md\:text-7xl {
        font-size: 4.5rem;
        line-height: 1;
    }
    
    .md\:text-5xl {
        font-size: 3rem;
        line-height: 1;
    }
    
    .md\:text-2xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    
    .md\:flex {
        display: flex;
    }
    
    .md\:hidden {
        display: none;
    }
    
    /* Background decorations - show on tablets and up */
    .absolute.top-20,
    .absolute.top-40,
    .absolute.bottom-40,
    .absolute.bottom-20 {
        display: block;
    }
}

/* Large devices (large desktops, 1024px and up) */
@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Form elements mobile responsiveness */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Button mobile responsiveness */
button {
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    border: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Mobile-first navigation improvements */
@media (max-width: 767px) {
    .mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid var(--gray-200);
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu.hidden {
        display: none;
    }
    
    .mobile-menu nav {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .mobile-menu a {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--gray-100);
        text-decoration: none;
        color: var(--gray-700);
        transition: color 0.2s ease;
    }
    
    .mobile-menu a:hover {
        color: var(--primary-blue);
    }
    
    .mobile-menu a:last-child {
        border-bottom: none;
        background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
        color: white;
        text-align: center;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
    }
}

/* Touch-friendly targets */
@media (max-width: 768px) {
    button,
    a,
    input,
    textarea,
    select {
        min-height: 44px;
        min-width: 44px;
    }
    
    .clickable {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .min-h-screen {
        min-height: 100vh;
    }
    
    .py-20 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .shadow-lg {
        box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.1), 0 4px 8px -2px rgba(0, 0, 0, 0.06);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-float,
    .animate-fade-in,
    .animate-slide-up,
    .animate-pulse,
    .animate-spin {
        animation: none;
    }
}

/* Focus visible for better accessibility */
@media (hover: hover) and (pointer: fine) {
    .focus-visible:focus-visible {
        outline: 2px solid var(--primary-blue);
        outline-offset: 2px;
    }
}