/* PadelPlaydate Custom Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --padel-green: #4caf50;
    --padel-blue: #2196f3;
    --padel-orange: #ff9800;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding-top: 70px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent horizontal scrolling on mobile */
    overflow-x: hidden;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--padel-blue), var(--padel-green));
    color: white;
    border-bottom: none;
    border-radius: 15px 15px 0 0 !important;
}

/* Button Styles */
.btn {
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--padel-blue), #1976d2);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--padel-green), #388e3c);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--padel-orange), #f57c00);
    border: none;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--padel-blue), var(--padel-green));
    color: white;
    border-radius: 20px;
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Features Section */
.features-section .card {
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.features-section .card:hover {
    border-color: var(--padel-blue);
}

/* User Stats */
.stat-item {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.stat-item:hover {
    background-color: var(--light-color);
}

.stat-item h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Match Cards */
.match-item {
    border-left: 4px solid var(--padel-green);
    padding: 1rem;
    background: white;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.match-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

/* Chat Styles */
.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-radius: 10px;
}

.message {
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 20px;
    max-width: 70%;
    word-wrap: break-word;
}

.message-content.own {
    background: linear-gradient(135deg, var(--padel-blue), #1976d2);
    color: white;
    margin-left: auto;
}

.message-content.other {
    background: var(--light-color);
    color: var(--dark-color);
}

/* Tournament Styles */
.tournament-details {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.tournament-bracket {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
}

/* Leaderboard Styles */
.leaderboard-item {
    border-left: 4px solid var(--padel-green);
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.rank-badge {
    min-width: 60px;
    text-align: center;
}

/* Profile Styles */
.profile-avatar {
    position: relative;
    display: inline-block;
}

.profile-avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, transparent, rgba(0, 123, 255, 0.2));
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Feed Styles */
.post-item {
    border-left: 4px solid var(--padel-blue);
    background: white;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.post-actions {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

.post-actions .btn {
    border-radius: 15px;
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
}

/* Map Styles */
.map-container {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Form Styles */
.form-control {
    border-radius: 10px;
    border: 2px solid #dee2e6;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--padel-blue);
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25);
}

.form-select {
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

/* Loading Spinner */
.spinner-border {
    color: var(--padel-blue);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-in-right {
    animation: slideInRight 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Navigation adjustments */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* Hero section adjustments */
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    /* Card spacing */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Stats adjustments */
    .stat-item h3 {
        font-size: 1.5rem;
    }
    
    /* Chat styles for mobile */
    .chat-messages {
        max-height: 300px;
        font-size: 0.9rem;
    }
    
    .message-content {
        max-width: 85%;
        font-size: 0.9rem;
    }
    
    /* Form adjustments */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Button adjustments */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Map container */
    .map-container {
        height: 250px;
    }
    
    /* Profile avatar */
    .profile-avatar .fa-5x {
        font-size: 3rem !important;
    }
    
    /* Tournament bracket */
    .tournament-bracket {
        padding: 1rem;
        overflow-x: auto;
    }
    
    /* Leaderboard adjustments */
    .leaderboard-item {
        padding: 0.75rem;
    }
    
    /* Footer adjustments */
    .footer {
        text-align: center;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .message-content {
        max-width: 90%;
        padding: 0.5rem 0.75rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .stat-item h3 {
        font-size: 1.25rem;
    }
    
    .stat-item {
        padding: 0.5rem;
    }
    
    /* Touch-friendly buttons */
    .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

/* Large mobile devices and small tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .match-item, .post-item {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
}

/* Mobile-first improvements */
.table-responsive {
    font-size: 0.9rem;
}

/* Better touch targets */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link, .dropdown-item, .form-control, .form-select {
        min-height: 44px;
    }
    
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Improve scrolling on mobile */
.chat-messages, .overflow-auto {
    -webkit-overflow-scrolling: touch;
}

/* Better form handling on mobile */
.form-floating > .form-control {
    font-size: 16px;
}

/* Sticky positioning improvements */
.sticky-top {
    position: -webkit-sticky;
    position: sticky;
}

/* Better list spacing on mobile */
@media (max-width: 768px) {
    .list-group-item {
        padding: 0.75rem;
    }
    
    .dropdown-menu {
        font-size: 0.9rem;
    }
    
    .alert {
        margin-bottom: 1rem;
        padding: 0.75rem;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
    }
    
    /* Mobile-specific improvements */
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
    .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
    .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Fix modal positioning on mobile */
    .modal {
        padding: 1rem;
    }
    
    .modal-dialog {
        margin: 0;
        max-width: 100%;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    /* Improve tables on mobile */
    .table-responsive {
        border-radius: 0.5rem;
    }
    
    /* Better spacing for mobile cards */
    .card-header + .card-body {
        padding-top: 1rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .stat-item h3 {
        font-size: 1.75rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #2c3e50;
        --dark-color: #ecf0f1;
    }
    
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .card {
        background-color: #2c3e50;
        color: #ffffff;
    }
    
    .text-muted {
        color: #bdc3c7 !important;
    }
}

/* Utility Classes */
.text-padel-blue {
    color: var(--padel-blue);
}

.text-padel-green {
    color: var(--padel-green);
}

.bg-padel-blue {
    background-color: var(--padel-blue);
}

.bg-padel-green {
    background-color: var(--padel-green);
}

.border-padel-blue {
    border-color: var(--padel-blue);
}

.border-padel-green {
    border-color: var(--padel-green);
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--padel-blue);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--padel-green);
}

/* PWA and Mobile App Enhancements */

/* PWA Install Button */
.install-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3); }
    50% { box-shadow: 0 6px 20px rgba(0, 123, 255, 0.5); }
    100% { box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3); }
}

/* Update Available Bar */
.update-available-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 8px 0;
    z-index: 1050;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile Touch Improvements */
.touch-friendly {
    min-height: 44px;
    min-width: 44px;
}

.btn-touch {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
}

/* Bottom Navigation for Mobile */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #dee2e6;
    display: none;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.75rem;
    min-width: 60px;
    transition: color 0.3s ease;
}

.mobile-nav-item.active {
    color: #007bff;
}

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

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
    /* Show mobile navigation */
    .mobile-nav {
        display: flex;
    }
    
    /* Add bottom padding to body when mobile nav is present */
    body {
        padding-bottom: 70px;
    }
    
    /* Improved touch targets */
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .nav-link, .btn-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Better spacing for mobile */
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Mobile-optimized cards */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Improved form layouts */
    .form-floating {
        margin-bottom: 1rem;
    }
}
