* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #1a1a1a;
    color: #fff;
    overflow-x: hidden;
}

.header, .board-header, .dashboard-header {
    overflow: visible !important;
}

.board-info-card, .dashboard-stats, .board-container, .columns-container {
    z-index: auto;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #0d0d0d;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #0f3df9, #00a86b);
    padding: 12px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 100;
}

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

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

.header-logo img {
    height: 36px;
    width: 36px;
    object-fit: cover;
    border-radius: 50%;
    overflow: hidden;
}

.header-left h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.back-btn {
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    height: 38px;
    padding: 0 16px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(12px);
    transition: all 0.2s;
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.38);
    border-color: rgba(255, 255, 255, 0.28);
}

/* Dark Glass Button (Header) */
.btn-glass,
.header-btn,
.dashboard-header .btn-glass {
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    height: 38px;
    padding: 0 16px;
    font-weight: 600;
    backdrop-filter: blur(12px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-glass:hover,
.header-btn:hover,
.dashboard-header .btn-glass:hover {
    background: rgba(0, 0, 0, 0.38);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

/* Dashboard Toggle Icon Button */
.dashboard-toggle-btn {
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.2s;
}

.dashboard-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.38);
    border-color: rgba(255, 255, 255, 0.28);
}

/* Create Embassy Card */
.create-embassy-card {
    background: rgba(0,0,0,0.25);
    border: 2px dashed rgba(255,255,255,0.25);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    min-height: 140px;
}

.create-embassy-card:hover {
    background: rgba(0,0,0,0.35);
    border-color: rgba(255,255,255,0.4);
}

.create-embassy-icon {
    font-size: 48px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 12px;
    line-height: 1;
}

.create-embassy-title {
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    font-weight: 600;
}

.btn-glass.btn-small {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 10px;
}

/* Primary Button Enhanced */
.btn-primary {
    background: linear-gradient(135deg, #2447ff, #1234d8);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    height: 38px;
    padding: 0 16px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(15,62,250,0.25);
    transition: all 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(15,62,250,0.35);
}

/* User Button Pill */
.user-btn {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    color: #fff;
    height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

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

.user-dropdown {
    position: relative;
    overflow: visible !important;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    backdrop-filter: blur(12px);
}

.user-btn:hover {
    background: rgba(0, 0, 0, 0.38);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00e400, #0f3df9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.user-menu {
    position: fixed !important;
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    min-width: 200px;
    overflow: visible !important;
    display: none;
    z-index: 2147483647 !important;
}

.user-menu.show {
    display: block;
}

.user-menu-item {
    padding: 12px 16px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu-item:hover {
    background: #2a2a2a;
}

.user-menu-item.divider {
    border-top: 1px solid #333;
    padding-top: 8px;
    margin-top: 4px;
}

.btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #0f3df9, #0056ff);
    color: white;
    box-shadow: 0 4px 12px rgba(15, 61, 249, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 61, 249, 0.4);
}

.btn-secondary {
    background: #2a2a2a;
    color: white;
    border: 1px solid #3a3a3a;
}

.btn-secondary:hover {
    background: #333;
}

.btn-outline {
    background: transparent;
    color: #0f3df9;
    border: 2px solid #0f3df9;
}

.btn-outline:hover {
    background: rgba(15, 61, 249, 0.1);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #bb2d3b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.15);
}

.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #0d0d0d;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.dashboard-stats {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid #2a2a2a;
    transition: all 0.3s ease;
}

.dashboard-summary-row {
    margin-bottom: 0;
}

.dashboard-expanded-content {
    margin-top: 24px;
}

.dashboard-stats.collapsed {
    max-height: none;
}

.dashboard-stats.collapsed .dashboard-expanded-content {
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: linear-gradient(135deg, #0f3df9, #001a4d);
    color: white;
    min-height: 90px;
    padding: 20px 24px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(15, 61, 249, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 8px;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.chart-container {
    background: #222;
    padding: 24px;
    border-radius: 14px;
    border: 1px solid #333;
}

.chart-container h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #e0e0e0;
    font-weight: 600;
}

.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.board-card {
    background: linear-gradient(145deg, #1f1f1f, #1a1a1a);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #2a2a2a;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}



.board-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    border-color: #3a3a3a;
}

.board-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.board-card-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.board-card-menu {
    opacity: 0;
    transition: opacity 0.2s;
}

.board-card:hover .board-card-menu {
    opacity: 1;
}

.board-card-info {
    color: #888;
}

.board-card-info small {
    font-size: 13px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #666;
}

.empty-state p {
    margin-bottom: 8px;
}

/* Board View */
.board-view {
    background: #0d0d0d;
}

.board-content {
    flex: 1;
    padding: 20px;
    overflow-x: auto;
    overflow-y: hidden;
}

.board-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.board-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.board-title-section h1 {
    font-size: 20px;
    font-weight: 700;
}

.board-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.columns-container {
    display: flex;
    gap: 16px;
    height: 100%;
    align-items: flex-start;
    padding: 10px 0;
}

.column {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 14px;
    width: 320px;
    max-height: calc(100vh - 260px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    flex-shrink: 0;
    overflow: hidden;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    font-weight: 600;
    color: #e0e0e0;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.column-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.add-card-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #e0e0e0;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.add-card-btn:hover {
    background: rgba(255,255,255,0.1);
}

.add-card-bottom-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px dashed rgba(255,255,255,0.12);
    background: transparent;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.add-card-bottom-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}

.cards-container {
    flex: 1 1 auto;
    padding: 12px;
    padding-bottom: 40px;
    overflow-y: auto;
    overflow-x: visible;
    min-height: 0;
}

.column.drag-over,
.cards-container.drag-over {
    min-height: 120px;
}

.add-card-bottom-wrapper {
    padding: 0 12px 12px 12px;
    flex-shrink: 0;
}

.card {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    margin-bottom: 10px;
}

.card:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-color: #0f3df9;
}

.card.dragging {
    opacity: 0.8;
    transform: none !important;
    transition: none !important;
    margin-bottom: 10px;
    z-index: 1000;
}

.card:not(.dragging) {
    /* Keep normal styles for non-dragging cards */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.3px;
}

.card-menu-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    padding: 0 6px;
    line-height: 1;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.4;
}

.card-desc {
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.stars-display {
    display: flex;
    gap: 3px;
}

.star {
    font-size: 20px;
    color: #444;
    cursor: pointer;
    transition: all 0.15s;
}

.star:hover {
    transform: scale(1.2);
}

.star.active {
    color: #ffc107;
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

.star-level {
    font-size: 12px;
    color: #888;
    font-weight: 500;
    padding: 4px 10px;
    background: #222;
    border-radius: 20px;
}

.add-column {
    background: rgba(0,0,0,0.2);
    width: 320px;
    border-radius: 14px;
    flex-shrink: 0;
}

.add-column-btn {
    width: 100%;
    padding: 16px;
    background: rgba(255,255,255,0.08);
    border: 2px dashed rgba(255,255,255,0.2);
    color: white;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.add-column-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-backdrop.hidden {
    display: none;
}

.modal {
    background: #1f1f1f;
    border-radius: 16px;
    width: min(760px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    margin: 24px auto;
    max-height: calc(100vh - 48px);
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.modal.large {
    max-width: 900px;
}

.modal.invite-modal {
    width: min(1000px, calc(100vw - 48px));
    max-width: 1000px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: #e0e0e0;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(255,255,255,0.15);
}

.modal-body {
    padding: 20px;
    overflow: visible;
    flex: 1;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    max-width: 100%;
    box-sizing: border-box;
}

.modal-body * {
    box-sizing: border-box;
    max-width: 100%;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #e0e0e0;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    font-size: 14px;
    color: #fff;
    transition: all 0.2s;
    min-height: 42px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0f3df9;
    background: #222;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #333;
}

/* Table styles */
.table-container {
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #2a2a2a;
}

.users-table th {
    background: #222;
    font-weight: 600;
    color: #e0e0e0;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: linear-gradient(135deg, #0f3df9, #0056ff);
    color: white;
}

.badge-secondary {
    background: #3a3a3a;
    color: white;
}

/* Tags selector */
.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    background: #2a2a2a;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.tag-option:hover {
    background: #333;
}

.tag-option:has(input:checked) {
    border-color: #0f3df9;
}

.tag-preview {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

/* Card Cover */
.card-cover {
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    margin: -14px -14px 14px -14px;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card Detail Modal - Cover Only */
.card-detail-cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.card-detail-cover-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.6);
    transform: scale(1.1);
}

.card-detail-cover-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    z-index: 2;
}

.card-detail-cover-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    min-width: 180px;
    overflow: hidden;
    display: none;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #2a2a2a;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 10px 16px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .boards-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .card-detail-body {
        grid-template-columns: 1fr;
    }
}
