/* =========================================
   GENEL DÜZEN (2 SÜTUNLU GRID)
   ========================================= */
.parties-dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    max-width: 1250px;
    margin: 0 auto;
    padding: 20px;
    height: calc(100vh - 60px);
    overflow: hidden;
    align-items: start;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   SOL SÜTUN: ARAÇ ÇUBUĞU VE LİSTE
   ========================================= */
.parties-main-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Toolbar */
.parties-toolbar {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.toolbar-top {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 10px 15px;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary);
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
}

.search-box i {
    color: var(--text-dim);
}

/* --- KOMPAKT İKON BUTONLARI --- */
.toolbar-icons {
    display: flex;
    gap: 6px;
}

.toolbar-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.toolbar-icon-btn:hover {
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.toolbar-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-card);
    line-height: 1;
}

.toolbar-badge.pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

/* --- DROPDOWN PANELLER --- */
.dropdown-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dim);
}

.dropdown-panel-header i {
    margin-right: 6px;
}

.dropdown-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    transition: 0.2s;
}

.dropdown-close:hover {
    color: #ef4444;
}

.dropdown-panel-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-panel-body::-webkit-scrollbar {
    width: 4px;
}

.dropdown-panel-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.dropdown-empty {
    text-align: center;
    padding: 15px;
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* Mini Koalisyon Row (dropdown içinde) */
.mini-coalition-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.mcr-info {
    flex: 1;
}

.mcr-info strong {
    font-size: 0.85rem;
    display: block;
}

.mcr-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.mcr-avatars {
    display: flex;
    gap: 4px;
}

.mcr-avatar {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* Mini Davetiye Row (dropdown içinde) */
.mini-invite-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.mir-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.mir-info {
    flex: 1;
    min-width: 0;
}

.mir-info strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
}

.mir-info span {
    font-size: 0.72rem;
    color: var(--text-dim);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mir-actions {
    display: flex;
    gap: 4px;
}

.mir-accept,
.mir-reject {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: 0.2s;
}

.mir-accept {
    color: #10b981;
}

.mir-accept:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}

.mir-reject {
    color: #ef4444;
}

.mir-reject:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* --- KALAN TOOLBAR VE LİSTE STİLLERİ --- */

.create-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 20px;
    height: 40px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    white-space: nowrap;
    font-size: 0.9rem;
}

.create-btn:hover {
    background-color: #2563eb;
}

.toolbar-bottom {
    display: flex;
    gap: 10px;
}

.filter-select {
    flex: 1;
    background: var(--bg-main);
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    font-size: 0.9rem;
}

.filter-select:hover {
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.2);
}

.list-header-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 700;
    letter-spacing: 1px;
    margin-left: 5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* --- SCROLL FIX --- */
.party-list-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 0 0 8px 8px;
}

.party-list-wrapper::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, rgba(5, 10, 20, 0) 0%, var(--bg-main) 100%);
    pointer-events: none;
    z-index: 5;
}

.party-list-grid {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 60px;
    padding-right: 5px;
}

.party-list-grid::-webkit-scrollbar {
    width: 6px;
}

.party-list-grid::-webkit-scrollbar-track {
    background: transparent;
}

.party-list-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.party-list-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Parti Kartı */
.party-row-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    animation: cardSlideIn 0.3s ease both;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.party-row-card:hover {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(3px);
}

.row-border-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.row-logo {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.row-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.row-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.row-name {
    font-weight: 700;
    color: var(--text-light);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.row-name img {
    height: 14px;
    opacity: 0.8;
}

.row-leader {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.coalition-chip {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.row-prestige {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
}

.row-stats {
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 12px;
    border-radius: 4px;
}

.row-stats i {
    color: var(--text-dim);
    margin-right: 5px;
    font-size: 0.8rem;
}

.row-seats {
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px 8px;
}

.row-seats i {
    color: var(--text-dim);
    margin-right: 4px;
    font-size: 0.75rem;
}

.row-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    cursor: pointer;
}

.row-btn:hover {
    border-color: var(--text-light);
    color: var(--text-light);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
}

/* =========================================
   SAĞ SÜTUN: WIDGETLAR
   ========================================= */
.parties-side-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 20px;
}

.parties-side-col::-webkit-scrollbar {
    display: none;
}

.side-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.widget-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 15px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header .badge {
    background: var(--accent);
    color: black;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
}

.widget-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Mini Öneri Satırı */
.mini-rec-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    background: var(--bg-main);
    border: 1px solid transparent;
    transition: 0.2s;
}

.mini-rec-row:hover {
    border-color: var(--border);
    background-color: rgba(255, 255, 255, 0.03);
}

.mini-logo {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mini-info {
    flex: 1;
}

.mini-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
}

.mini-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: block;
}

.arrow {
    font-size: 0.8rem;
    color: var(--text-dim);
    opacity: 0.5;
}

/* Bilgi Kutusu */
.info-box {
    padding: 15px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-shrink: 0;
}

.info-box i {
    color: var(--primary);
    margin-top: 3px;
}

.info-box p {
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.4;
}

/* Mobil */
@media (max-width: 900px) {
    .parties-dashboard-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .party-list-wrapper {
        height: 500px;
    }

    .parties-side-col {
        overflow: visible;
    }
}