@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #8b5cf6;
    /* Vibrant Purple */
    --accent-glow: rgba(139, 92, 246, 0.3);
    --vibrant-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --vibrant-orange: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --vibrant-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --danger-color: #ef4444;
    --border-radius: 24px;
    --glass-border: rgba(255, 255, 255, 0.5);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --user-art-size: 180px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(45deg, #fce7f3, #e0e7ff, #fef3c7);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Header & Typography */
.main-header {
    margin: -2.5rem -2.5rem 2.5rem -2.5rem;
    /* HEADER YÜKSEKLİĞİ BURADAKİ PADDING İLE AYARLANIR */
    /* 2.2rem (Üst) | 1.5rem (Sağ) | 1.2rem (Alt) | 1.5rem (Sol) */
    padding: 1.5rem 1.5rem 0.8rem 1.5rem;
    background: linear-gradient(135deg, #fdb100 0%, #f97316 100%);
    border-radius: 0;
    /* Köşeler artık düz / dikdörtgen */
    box-shadow: 0 15px 35px rgba(253, 177, 0, 0.2);
    position: relative;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo {
    /* LOGO BOYUTU BURADAN DEĞİŞİR (px cinsinden) */
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));
}

h1,
h2,
h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.logo-text {
    color: white;
    letter-spacing: 1px;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.refresh-btn {
    background: white;
    border: 1px solid #e2e8f0;
    color: #475569;
    cursor: pointer;
    padding: 10px;
    border-radius: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.logo-text::after {
    content: "LIVE";
    font-size: 0.75rem;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 5px;
    color: white;
    display: none;
    letter-spacing: 1.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.is-playing .logo-text::after {
    display: inline-block;
    animation: blink-live 1s ease-in-out infinite;
}

@keyframes blink-live {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

.spinning svg {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Status Indicator */
.status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
    transition: var(--transition);
}

.status.online {
    background-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* Professional On-Air Pulse Effect */
.is-playing .status.online::before,
.is-playing .status.online::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #22c55e;
    transform: translate(-50%, -50%);
    z-index: -1;
    opacity: 0.6;
}

.is-playing .status.online::before {
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.is-playing .status.online::after {
    animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) -0.4s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(4.5);
        opacity: 0;
    }
}

.status.offline {
    background-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Track Info */
.track-info {
    text-align: center;
    margin-bottom: 2.5rem;
}

.album-art-container {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto 1.5rem auto;
}

.album-art {
    width: 100%;
    height: 100%;
    border-radius: 32px;
    object-fit: cover;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.2);
    border: 6px solid white;
    transition: transform 0.5s ease;
}

.track-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: #0f172a;
}

.dj-panel {
    background: #f8fafc;
    padding: 15px 20px;
    border-radius: 20px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 1px solid #f1f5f9;
    max-width: 320px;
}

.dj-profile-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.dj-details {
    text-align: left;
}

.dj-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.dj-name-text {
    display: block;
    font-weight: 800;
    color: var(--accent-color);
    font-size: 1.2rem;
    line-height: 1.2;
}

/* Play Button */
.player-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.play-btn {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: var(--vibrant-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.4);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.play-btn:hover {
    transform: scale(1.1) translateY(-5px);
}

.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent white;
    margin-left: 8px;
}

.pause-icon {
    width: 24px;
    height: 30px;
    border-left: 8px solid white;
    border-right: 8px solid white;
    display: none;
}

.playing .play-icon {
    display: none;
}

.playing .pause-icon {
    display: block;
}

.playing .play-btn {
    background: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.playing .pause-icon {
    border-left-color: #0f172a;
    border-right-color: #0f172a;
}

/* Stats Grid & Action Buttons */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 22px 15px;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}

.stat-desc {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.2;
    margin-top: 5px;
    font-weight: 500;
}

/* Action Link Buttons */
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    border-radius: 24px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.action-btn:hover {
    transform: translateY(-5px);
}

.btn-istek {
    background: var(--vibrant-orange);
    box-shadow: 0 15px 30px -5px rgba(245, 158, 11, 0.4);
}

.btn-yonetim {
    background: var(--vibrant-blue);
    box-shadow: 0 15px 30px -5px rgba(59, 130, 246, 0.4);
}

.btn-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.btn-text {
    font-size: 0.85rem;
    line-height: 1.2;
}

/* History */
.history-section {
    background: #f8fafc;
    padding: 25px;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
}

.history-section h4 {
    margin-bottom: 1.5rem;
    color: #475569;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: left;
}

.history-item {
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
    color: #475569;
    font-weight: 500;
}

.history-item:hover {
    color: var(--accent-color);
}

/* Logout Button */
.btn-logout {
    margin-top: 2.5rem;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    width: 100%;
    padding: 18px;
    display: block;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(239, 68, 68, 0.4);
    filter: brightness(1.1);
}

/* Login Page Styles */
.login-box {
    text-align: center;
    padding: 10px 0;
}

.welcome-text {
    font-size: 1.8rem;
    color: #0f172a;
    margin-bottom: 5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.error-box {
    background: #fee2e2;
    color: #ef4444;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid #fecaca;
}

/* Giriş Formu ve Elemanları */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    /* Formu tam genişlik yapar */
}

.password-wrapper {
    position: relative;
    width: 100%;
}

input[type="password"],
input[type="text"] {
    width: 100%;
    /* GENİŞLİK BURADAN AYARLANIR */
    padding: 20px 60px 20px 20px;
    /* Sağ tarafa ikon için boşluk bırakıldı */
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    font-size: 1.1rem;
    /* YAZI BOYUTU */
    color: #0f172a;
    outline: none;
    transition: var(--transition);
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border-radius: 10px;
}

.toggle-password:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #f97316;
}

.toggle-password.active {
    color: #f97316;
}

input[type="password"]:focus,
input[type="text"]:focus {
    border-color: #f97316;
    background: white;
    box-shadow: 0 0 0 4px rgba(253, 177, 0, 0.2);
}

.btn-primary {
    width: 100%;
    /* BUTON GENİŞLİĞİ %100 */
    padding: 20px;
    /* BUTONU KALINLAŞTIRAN KISIM */
    border-radius: 15px;
    border: none;
    background: linear-gradient(135deg, #fdb100 0%, #f97316 100%);
    /* Başlıkla uyumlu renk */
    color: white;
    font-size: 1.2rem;
    /* BUTON YAZI BOYUTU */
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(253, 177, 0, 0.3);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(253, 177, 0, 0.4);
    filter: brightness(1.1);
}

/* User (Listener) View Optimizations */
.user-view .album-art-container {
    width: var(--user-art-size);
    height: var(--user-art-size);
    margin-bottom: 1rem;
}

.user-view .track-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.user-view .dj-panel {
    padding: 10px 15px;
    margin-top: 10px;
}

.user-view .player-controls {
    margin-bottom: 1.5rem;
}

.user-view .play-btn {
    width: 120px;
    height: 120px;
    /* Play butonunu çok daha belirgin yaptık */
    box-shadow: 0 25px 50px rgba(139, 92, 246, 0.5);
}

.user-view .btn-istek {
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    padding: 18px 25px;
}

.user-view .btn-istek .btn-icon {
    font-size: 2.2rem;
    margin-bottom: 0;
}

.user-view .btn-istek .btn-text {
    font-size: 1.4rem;
    text-align: left;
}

.user-actions {
    margin-bottom: 2rem;
}

.full-width {
    width: 100% !important;
}

.dj-login-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: var(--transition);
}

.dj-login-link:hover {
    opacity: 1;
    transform: scale(1.05);
}

.btn-home {
    margin-top: 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    width: 100%;
    padding: 18px;
    display: block;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
}

.btn-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3);
    filter: brightness(1.1);
}

.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    color: #f97316;
}

/* Responsive fixes */
@media (max-width: 480px) {
    .container {
        padding: 2rem 1.0rem;
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
    }

    body {
        padding: 0;
    }

    .container.user-view {
        padding: 1.5rem 1rem;
    }

    .user-view .album-art-container {
        width: 150px;
        height: 150px;
    }

    .welcome-text {
        font-size: 1.5rem;
    }
}

/* Dinleyici Konumları Tablosu Styles */
.listeners-map-section {
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 2.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.section-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.live-badge {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
    animation: blink-live 1.5s infinite;
}

.live-badge.badge-blue {
    background: var(--accent-color);
}

.index-cell {
    font-weight: 700;
    color: var(--text-secondary);
    width: 30px;
}

.listeners-table-container {
    overflow-x: auto;
    width: 100%;
}

.listeners-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.listeners-table th {
    padding: 10px 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

.listeners-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f8fafc;
    color: var(--text-primary);
    vertical-align: middle;
}

.listeners-table tr:last-child td {
    border-bottom: none;
}

.flag-icon {
    font-size: 1.2rem;
    margin-right: 5px;
}

.ip-cell {
    font-family: 'Courier New', Courier, monospace;
    color: #94a3b8;
    font-size: 0.8rem;
}

.empty-msg {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px !important;
    font-style: italic;
}

.device-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.device-tag.mobil {
    background: #dcfce7;
    color: #15803d;
}

.device-tag.pc {
    background: #e0e7ff;
    color: #4338ca;
}