/**
 * SafeChat P2P - Bileşen Stilleri
 */

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #2d8049;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c73e40;
}

.btn-secondary {
    background-color: var(--bg-input);
    color: var(--text-normal);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-normal);
}

.btn-ghost:hover {
    background-color: var(--bg-hover);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== FORM INPUTS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--header-secondary);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-dark);
    border: 1px solid var(--bg-dark);
    border-radius: var(--border-radius-sm);
    color: var(--text-normal);
    font-size: 16px;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    border-color: var(--primary);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.error {
    border-color: var(--danger);
}

.form-error {
    margin-top: 4px;
    font-size: 12px;
    color: var(--danger);
}

.form-help {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 16px;
    text-align: center;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--header-primary);
    margin-bottom: 8px;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.modal-body {
    padding: 0 16px 16px;
}

.modal-footer {
    padding: 16px;
    background-color: var(--bg-tertiary);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== CALL MODAL (Gelen Arama) - Premium Update ===== */
.call-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.call-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.call-avatar-wrapper {
    position: relative;
    margin-bottom: 40px;
}

.call-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7289da 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    font-weight: 700;
    color: white;
    position: relative;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(88, 101, 242, 0.4);
    z-index: 1;
}

.call-avatar-ring {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    background-color: var(--primary);
    opacity: 0.15;
    animation: ring-pulse 2s infinite ease-out;
    z-index: 0;
}

@keyframes ring-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.call-info {
    text-align: center;
    margin-bottom: 48px;
}

.call-name {
    font-size: 32px;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.call-status {
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    font-weight: 500;
}

.call-actions {
    display: flex;
    gap: 40px;
}

.call-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-high);
}

.call-btn:hover {
    transform: scale(1.15) rotate(5deg);
}

.call-btn-accept {
    background: linear-gradient(135deg, #43b581 0%, #3ca374 100%);
    animation: call-bounce 1s infinite;
}

.call-btn-reject {
    background: linear-gradient(135deg, #f04747 0%, #d83c3e 100%);
}

@keyframes call-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ===== VIDEO CALL OVERLAY - Premium Update ===== */
.video-overlay {
    position: fixed;
    inset: 0;
    background-color: #0c0c0d;
    z-index: 10001;
    /* ChatGPT tarzı overlay */
    display: none;
    flex-direction: column;
}

.video-overlay.active {
    display: flex;
}

.video-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 24px 32px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.video-security {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--success);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(67, 181, 129, 0.2);
}

.video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 80px 20px 100px;
    align-items: center;
    justify-items: center;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        padding: 80px 12px 140px;
    }
}

.video-container {
    position: relative;
    background-color: #1e1f22;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    height: 100%;
    max-height: 600px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container video {
    width: 100%;
    height: 100%;
}

#local-video {
    transform: scaleX(-1);
    /* Mirror self video */
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.video-placeholder-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    color: var(--text-normal);
}

.video-label {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    backdrop-filter: blur(4px);
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 100;
}

.video-control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.video-control-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.video-control-btn.active {
    background-color: white;
    color: #1e1f22;
}

.video-control-btn.end-call {
    background: linear-gradient(135deg, #f04747 0%, #d83c3e 100%);
    width: 64px;
    height: 64px;
    border: none;
}

.video-control-btn.end-call:hover {
    background: #f04747;
    transform: translateY(-2px) scale(1.05);
}

/* Audio Only Mode Styles */
.video-overlay.is-audio-only #local-video {
    display: none;
}

.video-overlay.is-audio-only .video-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
}

.video-overlay.is-audio-only .video-placeholder-avatar {
    width: 150px;
    height: 150px;
    font-size: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, #4752c4 100%);
    box-shadow: 0 0 30px rgba(88, 101, 242, 0.3);
}

.video-control-btn i.fa-video-slash,
.video-control-btn i.fa-microphone-slash {
    color: #f04747;
}

.video-control-btn.disabled {
    background-color: rgba(240, 71, 71, 0.2);
    color: #f04747;
    border-color: rgba(240, 71, 71, 0.3);
}

.video-control-btn.active {
    background-color: #ffffff;
    color: #1e1f22;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.tab {
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-normal);
}

.tab.active {
    color: var(--header-primary);
    border-bottom-color: var(--primary);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    background-color: var(--danger);
    color: white;
}

.badge-primary {
    background-color: var(--primary);
}

/* ===== TOOLTIPS ===== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: var(--bg-dark);
    color: var(--text-normal);
    font-size: 13px;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    margin-bottom: 8px;
    box-shadow: var(--shadow-high);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ===== LOADING ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-input);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--header-secondary);
    margin-bottom: 8px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 3000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--bg-dark);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-high);
    animation: slide-in 0.3s ease;
    max-width: 400px;
}

@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-icon {
    font-size: 20px;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--header-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 14px;
    color: var(--text-muted);
}

.toast-close {
    color: var(--text-muted);
    background: transparent;
    padding: 4px;
}

.toast-close:hover {
    color: var(--text-normal);
}