/* Genel Sıfırlama ve Font Ayarları */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Ana Konteyner */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Üst Bilgi Alanı */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.device-id {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    letter-spacing: 1px;
}

/* Bağlantı Durumu Göstergesi (Sağ Üst) */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.connected { background: #d4edda; color: #155724; }
.disconnected { background: #f8d7da; color: #721c24; }

/* İçerik ve Bölümler */
.content {
    padding: 30px;
}

.section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Dosya Yükleme Alanı */
.file-input-wrapper {
    position: relative;
    background: white;
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-wrapper:hover {
    background: #f8f9fa;
    border-color: #764ba2;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.file-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.file-info {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    display: none;
}

/* Cihaz Listesi */
.device-item {
    background: white;
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 10px;
    border-left: 5px solid #667eea;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}

.device-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.device-item-top > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.device-progress {
    display: none;
}

.progress-bar-sm {
    width: 100%;
    height: 16px;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.progress-fill-sm {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7em;
    line-height: 16px;
    text-align: center;
    transition: width 0.3s ease;
    white-space: nowrap;
}

.progress-label {
    display: block;
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 4px;
}

.progress-speed:empty {
    display: none;
}

.device-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.device-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
}

.device-send-btn:hover:not(:disabled),
.device-send-btn:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.device-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #adb5bd;
}

@media (max-width: 480px) {
    .device-item {
        padding: 12px 14px;
    }
    .device-item-top {
        flex-wrap: wrap;
    }
    .device-send-btn {
        padding: 12px 18px;
        min-height: 44px;
        width: 100%;
        margin-top: 6px;
    }
}

.device-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-left-color: white;
}

/* Butonlar */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
    font-weight: bold;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress Bar (Yükleme Çubuğu) */
.progress-container {
    display: none;
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Uyarı ve Bilgi Mesajları (Alerts) */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px 0;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert.success { background: #d4edda; color: #155724; border: 2px solid #c3e6cb; }
.alert.error { background: #f8d7da; color: #721c24; border: 2px solid #f5c6cb; }
.alert.info { background: #d1ecf1; color: #0c5460; border: 2px solid #bee5eb; }

/* Boş Durum (Empty State) */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 4em;
    opacity: 0.3;
}

.transfer-speed {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

/* Discovery Section (header) */
.discovery-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.disc-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.disc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.25s;
    cursor: default;
}

.disc-badge.disc-active {
    background: rgba(255,255,255,0.25);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.5);
}

.disc-badge.disc-hidden {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.4);
    border: 1.5px solid rgba(255,255,255,0.15);
}

#roomDiscMain {
    cursor: pointer;
}

#roomDiscBadge.disc-active:hover {
    background: rgba(255,255,255,0.33);
}

.eye-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 0.95em;
    line-height: 1;
    user-select: none;
    transition: opacity 0.15s;
}

.eye-toggle:hover {
    opacity: 0.65;
}

.eye-toggle.slashed::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -2px;
    right: -2px;
    height: 2px;
    background: currentColor;
    transform: rotate(-35deg);
    transform-origin: center;
    pointer-events: none;
}

.disc-actions {
    display: flex;
    gap: 8px;
}

.disc-action-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.45);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.disc-action-btn:hover {
    background: rgba(255,255,255,0.35);
}

/* Room Modal */
.room-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.room-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.room-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 32px 28px 24px;
    width: 340px;
    max-width: 95vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.room-modal-title {
    font-size: 1.3em;
    color: #333;
    font-weight: 700;
}

.room-qr {
    display: flex;
    justify-content: center;
}

.room-code-display {
    font-size: 2.2em;
    font-weight: 800;
    letter-spacing: 6px;
    color: #667eea;
    font-family: 'Courier New', monospace;
}

.room-hint {
    font-size: 0.82em;
    color: #6c757d;
    text-align: center;
    margin-top: -8px;
}

.room-divider {
    font-size: 0.82em;
    color: #adb5bd;
    width: 100%;
    text-align: center;
}

.room-char-inputs {
    display: flex;
    gap: 8px;
}

.room-char-input {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 1.4em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
}

.room-char-input:focus {
    border-color: #667eea;
}

.room-modal-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.room-btn-group {
    display: flex;
    gap: 8px;
}

.room-btn {
    padding: 9px 18px;
    border-radius: 10px;
    border: none;
    font-size: 0.92em;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.room-btn:hover:not(:disabled) {
    opacity: 0.85;
    transform: translateY(-1px);
}

.room-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.room-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.room-btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.room-btn-danger {
    background: #f8d7da;
    color: #721c24;
}