/* ========================================
   RakipAra - Modern 3D Tasarım
   ======================================== */

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --accent: #f093fb;
    --dark: #1a1a2e;
    --light: #f5f7fa;
    --border: #e9ecef;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(102, 126, 234, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    color: var(--dark);
    overflow-x: hidden;
}

/* Touch device optimizasyonu */
@media (hover: none) {
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* ========================================
   Genel Componentler - 3D Modern
   ======================================== */

.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    transition: left 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 60px var(--shadow-lg);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 15px;
    padding: 12px 28px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.form-control, .form-select {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

/* ========================================
   Alert Mesajları - Modern
   ======================================== */

.alert {
    border: none;
    border-radius: 15px;
    padding: 16px 45px 16px 20px;
    border-left: 5px solid;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    animation: slideInRight 0.4s ease;
    position: relative;
}

.alert .btn-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #065F46;
    border-left-color: #10B981;
}

.alert-danger {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #991B1B;
    border-left-color: #EF4444;
}

.alert-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: var(--primary);
    border-left-color: var(--primary);
}

/* ========================================
   Dashboard Layout - Modern Sidebar
   ======================================== */

.sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    min-height: 100vh;
    padding: 20px 0;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.08);
    position: relative;
}

.sidebar h4 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* Mobil Menü Toggle Butonu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: rgba(37, 99, 235, 0.3);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 50px;
    height: 50px;
    border-radius: 10px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: rgba(37, 99, 235, 0.6);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.mobile-menu-toggle:active,
.mobile-menu-toggle.active {
    background: var(--primary);
    color: white;
    border-color: transparent;
    transform: scale(0.95);
}

.mobile-menu-toggle i {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: block;
    padding: 14px 20px;
    color: var(--dark);
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.3s ease;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    border-left-color: var(--primary);
    color: var(--primary);
    transform: translateX(5px);
}

.sidebar-menu a.active::before {
    width: 4px;
}

/* ========================================
   Takım Kartları
   ======================================== */

.team-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.team-card:hover::before {
    left: 100%;
}

.team-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px var(--shadow-lg);
}

.team-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--light);
}

.team-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 10px 0 5px;
    color: var(--dark);
}

.team-info {
    font-size: 0.9rem;
    color: #6B7280;
    margin-bottom: 5px;
}

.team-info i {
    margin-right: 5px;
    color: var(--primary);
}

/* ========================================
   Badge'ler - Modern
   ======================================== */

.badge {
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.badge:hover {
    transform: scale(1.05);
}

.badge-sport {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: var(--primary);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.badge-level {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    border: 2px solid #FDE047;
}

.badge-age {
    background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
    color: #6B21A8;
    border: 2px solid #D8B4FE;
}

/* ========================================
   İstatistik Kartları - 3D Modern
   ======================================== */

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px var(--shadow-lg);
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    transform: rotate(-5deg);
}

.stat-card:hover .stat-icon {
    transform: rotate(0deg) scale(1.1);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.95rem;
    color: #6B7280;
    font-weight: 600;
}

/* ========================================
   Maç Teklifi Kartları - 3D Modern
   ======================================== */

.match-request-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    border-left: 5px solid transparent;
    border-image: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) 1;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.match-request-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
}

.match-request-card:hover {
    transform: translateX(5px);
    box-shadow: 0 15px 50px var(--shadow-lg);
}

.match-date {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.match-location {
    color: #6B7280;
    font-size: 0.9rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-beklemede {
    background: #FEF3C7;
    color: #92400E;
}

.status-onaylandi {
    background: #D1FAE5;
    color: #065F46;
}

.status-reddedildi {
    background: #FEE2E2;
    color: #991B1B;
}

/* ========================================
   Mesajlaşma
   ======================================== */

.chat-container {
    background: white;
    border-radius: 12px;
    height: 600px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow);
    position: relative;
}

.chat-list {
    width: 300px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
}

.chat-item {
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.chat-item:hover, .chat-item.active {
    background: var(--light);
}

.chat-item .form-check-input {
    cursor: pointer;
}

.chat-item a {
    cursor: pointer;
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #F9FAFB;
    max-height: calc(100% - 80px);
    scroll-behavior: smooth;
}

.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-sent {
    background: var(--primary);
    color: white;
    margin-left: auto;
}

.message-received {
    background: white;
    color: var(--dark);
}

.chat-input {
    padding: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    background: white;
    position: relative;
    flex-shrink: 0;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    /* Mobil menü toggle butonu göster */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Sidebar mobilde gizli, toggle ile açılır */
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        transition: left 0.3s ease;
        z-index: 1000;
        top: 0;
        bottom: 0;
        overflow-y: auto;
    }
    
    .sidebar.active {
        left: 0;
        box-shadow: 4px 0 16px rgba(0,0,0,0.3);
    }
    
    /* Overlay - menü açıkken arka planı karart */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Main content mobilde tam genişlik */
    .col-md-10 {
        width: 100% !important;
        padding: 80px 15px 15px !important;
    }
    
    .col-md-2 {
        width: 280px !important;
    }
    
    /* Takım kartları mobilde tek sütun */
    .team-card {
        margin-bottom: 15px;
    }
    
    /* Takım logosu mobilde küçült */
    .team-logo {
        width: 60px;
        height: 60px;
    }
    
    /* İstatistik kartları mobilde daha küçük */
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    /* Tablo mobilde scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Form inputlar mobilde tam genişlik */
    .form-control, .form-select {
        font-size: 16px; /* iOS zoom engellemek için */
    }
    
    /* Butonlar mobilde tam genişlik */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
    
    /* Chat container mobilde düzelt */
    .chat-container {
        height: calc(100vh - 150px);
        flex-direction: column;
        min-height: 500px;
    }
    
    .chat-list {
        width: 100%;
        display: block;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 50vh;
        flex-shrink: 0;
    }
    
    .chat-content {
        width: 100%;
        display: none;
        flex: 1;
        min-height: 0;
    }
    
    .chat-messages {
        max-height: none;
        height: auto;
    }
    
    /* Konuşma seçildiğinde liste gizle, içerik göster */
    .chat-container.conversation-selected .chat-list {
        display: none;
    }
    
    .chat-container.conversation-selected .chat-content {
        display: flex;
        height: 100%;
    }
    
    /* Alert'ler mobilde düzelt */
    .alert {
        font-size: 0.9rem;
        padding: 12px 40px 12px 15px;
    }

    .alert .btn-close {
        top: 10px;
        right: 10px;
        transform: none;
    }
    
    /* Card'lar mobilde padding azalt */
    .card-body {
        padding: 15px;
    }
    
    /* Hero section mobilde küçült */
    .hero {
        padding: 60px 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    /* Navbar mobilde düzelt */
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Tablet için */
@media (min-width: 769px) and (max-width: 992px) {
    .col-md-10 {
        width: 82%;
    }
    
    .col-md-2 {
        width: 18%;
    }
    
    .sidebar {
        padding: 15px 10px;
    }
    
    .sidebar-menu a {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}

/* Küçük telefonlar için */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        font-size: 22px;
        top: 12px;
        left: 12px;
        background: rgba(37, 99, 235, 0.25);
    }

    .mobile-menu-toggle:hover {
        background: rgba(37, 99, 235, 0.5);
    }

    .mobile-menu-toggle:active,
    .mobile-menu-toggle.active {
        background: var(--primary);
    }

    .stat-card {
        margin-bottom: 10px;
    }

    .team-card {
        padding: 15px;
    }

    .match-request-card {
        padding: 15px;
    }

    /* Alert'ler küçük ekranlarda daha kompakt */
    .alert {
        font-size: 0.85rem;
        padding: 10px 35px 10px 12px;
    }

    .alert .btn-close {
        top: 8px;
        right: 8px;
        transform: none;
        font-size: 0.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    h5 {
        font-size: 1rem;
    }
}

/* ========================================
   Loading & Animasyonlar
   ======================================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}