/**
 * Leila Cafe - Mobil Uygulama Tarzı CSS
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Container */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f8f9fa;
    position: relative;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.app-header p {
    font-size: 14px;
    opacity: 0.9;
}

.header-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 12px;
    padding: 5px 15px;
    transition: color 0.3s;
}

.nav-item.active {
    color: #e94560;
}

.nav-item .icon {
    font-size: 24px;
    margin-bottom: 4px;
}

/* Content */
.app-content {
    padding: 20px;
    padding-bottom: 80px;
}

/* Cards */
.card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

/* Game Cards */
.game-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.game-card:active {
    transform: scale(0.98);
}

.game-card-image {
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
}

.game-card-content {
    padding: 20px;
}

.game-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.game-card-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.game-card-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #999;
}

.game-card-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: white;
    width: 100%;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #e94560;
}

/* Code Input */
.code-input-container {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.code-input {
    width: 100%;
    padding: 18px;
    border: 3px dashed #e0e0e0;
    border-radius: 15px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 700;
    text-transform: uppercase;
    transition: border-color 0.3s;
}

.code-input:focus {
    outline: none;
    border-color: #e94560;
    border-style: solid;
}

.code-input::placeholder {
    letter-spacing: 2px;
    font-size: 16px;
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    margin-right: 15px;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: white;
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    color: white;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
    color: white;
}

.rank-other {
    background: #f0f0f0;
    color: #666;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 15px;
}

.leaderboard-games {
    font-size: 12px;
    color: #999;
}

.leaderboard-score {
    font-size: 18px;
    font-weight: 700;
    color: #e94560;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #e94560;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

/* Tabs */
.tabs {
    display: flex;
    background: white;
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    background: none;
}

.tab.active {
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: white;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}

/* User Profile */
.profile-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    color: white;
    border-radius: 0 0 30px 30px;
    margin: -20px -20px 20px -20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 15px;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
}

.profile-email {
    font-size: 14px;
    opacity: 0.9;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 15px;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #e94560;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: #999; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    
    .app-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}
