/* Tooltip for Last Connection on Username Box */
.username-box[data-tooltip-text]:hover::after {
    content: attr(data-tooltip-text);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 110%; /* Position above the element */
    background-color: #1f2937; /* bg-gray-800 */
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem; /* text-xs */
    white-space: nowrap;
    z-index: 50; /* Ensure it's on top */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none; /* Prevents the tooltip from interfering with mouse events */
}

.light-theme .username-box[data-tooltip-text]:hover::after {
    background-color: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}



/* ADD THIS NEW BLOCK to your style.css file, with the other gradient styles */

.bg-gradient-to-r.from-teal-500.to-cyan-500 {
    background: linear-gradient(135deg, #14b8a6, #06b6d4);
    border: none;
    color: white;
}

.bg-gradient-to-r.from-teal-500.to-cyan-500:hover {
    background: linear-gradient(135deg, #0d9488, #0891b2);
}

.light-theme .bg-gradient-to-r.from-teal-500.to-cyan-500 {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #1a1a1a;
}

.alert {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}
.hajm {
font-size: 0.7rem;
}


.light-theme .bg-tarikh{
	background-color: #ffffff;
	border: 1px solid #d1d5db;
}
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.slider.disabled {
    background-color: #666;
    cursor: not-allowed;
}

.slider.disabled:before {
    background-color: #ccc;
    transform: translateX(0);
}

details[open] .details-arrow-down {
    display: none;
}

details[open] .details-arrow-up {
    display: block;
}

.text-red-500 {
    color: #ef4444;
}

.text-orange-500 {
    color: #f97316;
}

.text-green-500 {
    color: #22c55e;
}

.status-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.status-circle.online {
    background-color: #22c55e;
    animation: pulse 0.8s infinite;
}

.status-circle.offline {
    background-color: #6b7280;
    animation: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#onlineUsersCount, #totalUsersCount, #disabledUsersCount, #expiredUsersCount {
    font-size: 1.5rem;
    color: #22c55e;
}

#disabledUsersCount {
    color: #f97316;
}

#expiredUsersCount {
    color: #ef4444;
}

.light-theme {
    background-color: #ffffff;
    color: #1a1a1a;
}

.light-theme .bg-gray-800 {
    background-color: #f3f4f6;
    color: #1a1a1a;
}

.light-theme .bg-gray-700 {
    background-color: #e5e7eb;
    color: #1a1a1a;
}

.light-theme .text-white {
    color: #1a1a1a;
}

.light-theme .bg-gradient-to-r.from-purple-600.to-blue-600 {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #1a1a1a;
}

.light-theme .bg-gradient-to-r.from-yellow-600.to-orange-600 {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #1a1a1a;
}

.light-theme .bg-gradient-to-r.from-red-600.to-pink-600 {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #1a1a1a;
}

.light-theme .bg-gradient-to-r.from-green-600.to-teal-600 {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #1a1a1a;
}

.light-theme .theme-toggle-button {
    background: linear-gradient(90deg, #e5e7eb, #d1d5db);
    color: #1a1a1a;
}

.light-theme .theme-toggle-button:hover {
    background: linear-gradient(90deg, #d1d5db, #9ca3af);
}

.light-theme .bg-gradient-to-r.from-purple-600.to-blue-600,
.light-theme .bg-gradient-to-r.from-yellow-600.to-orange-600,
.light-theme .bg-gradient-to-r.from-red-600.to-pink-600,
.light-theme .bg-gradient-to-r.from-green-600.to-teal-600 {
    color: #1a1a1a;
}

.light-theme .bg-gradient-to-r.from-purple-600.to-blue-600 .text-sm,
.light-theme .bg-gradient-to-r.from-yellow-600.to-orange-600 .text-sm,
.light-theme .bg-gradient-to-r.from-red-600.to-pink-600 .text-sm,
.light-theme .bg-gradient-to-r.from-green-600.to-teal-600 .text-sm {
    color: #1a1a1a;
}

.light-theme .bg-gradient-to-r.from-purple-600.to-blue-600 .text-white,
.light-theme .bg-gradient-to-r.from-yellow-600.to-orange-600 .text-white,
.light-theme .bg-gradient-to-r.from-red-600.to-pink-600 .text-white,
.light-theme .bg-gradient-to-r.from-green-600.to-teal-600 .text-white {
    color: #1a1a1a;
}

.traffic-details {
  position: absolute;
        background: rgba(30, 41, 59, 0.95);
        border-radius: 6px;
        padding: 8px 12px;
        color: white;
        font-size: 0.8rem;
        z-index: 100;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        display: none;
        min-width: 120px;
}

.traffic-details span {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.traffic-details span:last-child {
    margin-bottom: 0;
}

.bg-gradient-to-r.from-purple-600.to-blue-600:hover .traffic-details {
    display: block;
}

.bg-gradient-to-r.from-purple-600.to-blue-600 {
    background: linear-gradient(135deg, #6b46c1, #3b82f6);
}

.bg-gradient-to-r.from-yellow-600.to-orange-600 {
    background: linear-gradient(135deg, #d97706, #f97316);
}

.bg-gradient-to-r.from-red-600.to-pink-600 {
    background: linear-gradient(135deg, #dc2626, #ec4899);
}

.bg-gradient-to-r.from-green-500.to-emerald-500 {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
}

.bg-gradient-to-r.from-green-500.to-emerald-500:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.light-theme .bg-gradient-to-r.from-green-500.to-emerald-500 {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #1a1a1a;
}

.text-orange-500.data-limit {
    color: #f97316;
    font-weight: bold;
}

.text-red-500.expired {
    color: #ef4444;
    font-weight: bold;
}

.traffic-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    margin-right: 4px;
}

.glass-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.gradient-text {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.status-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.progress-bar {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.5s ease;
}

.download-btn {
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.stat-card {
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}


.node-card {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s ease;
    border-left: 4px solid #6b7280;
}

.node-card:hover {
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
}

.node-card.online {
    border-left-color: #22c55e;
}

.node-card.offline {
    border-left-color: #ef4444;
}

.node-card.error {
    border-left-color: #f97316;
}

.node-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.node-status.online {
    background-color: #22c55e;
    box-shadow: 0 0 10px #22c55e;
    animation: pulse 1.5s infinite;
}

.node-status.offline {
    background-color: #ef4444;
}

.node-status.error {
    background-color: #f97316;
}

.node-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.node-action-btn {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.node-action-btn.sync {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.node-action-btn.sync:hover {
    background: rgba(59, 130, 246, 0.4);
}

.node-action-btn.delete {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.node-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.4);
}

.node-action-btn.status {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.node-action-btn.status:hover {
    background: rgba(156, 163, 175, 0.4);
}

@keyframes progress-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

#syncProgressBar {
    animation: progress-pulse 1.5s infinite;
}

.sync-step {
    transition: all 0.3s ease;
}

.sync-step.completed {
    color: #22c55e;
}

.sync-step.completed i {
    color: #22c55e;
    animation: none;
}

.sync-step.failed {
    color: #ef4444;
}

.sync-step.failed i {
    color: #ef4444;
    animation: none;
}


.connection-badge {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connection-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	z-index:25;
}

.server-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.server-icon.main svg {
    color: #8b5cf6;
}

.server-icon.node svg {
    color: #3b82f6;
}

.download-option {
    transition: all 0.2s ease;
}

.download-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.download-option .server-icon {
    margin-right: 8px;
}


/* === START: Modern Add Node Modal & Progress Tracker Styles === */

/* Main Modal Styling */
#addNodeModal .modal-content {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Progress Tracker Styling */
.progress-tracker {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Space between steps */
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
}

#addNodeProgress.visible {
    max-height: 500px; /* A large enough value */
    opacity: 1;
    margin-top: 1.5rem; /* Add space when visible */
}

.step-item {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    opacity: 0.5; /* Default state is dimmed */
}

.step-item.in-progress {
    opacity: 1;
}
.step-item.completed, .step-item.failed {
    opacity: 1;
}

.step-icon {
    flex-shrink: 0;
    width: 2.25rem; /* w-9 */
    height: 2.25rem; /* h-9 */
    border-radius: 9999px; /* rounded-full */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #4b5563; /* border-gray-600 */
    background-color: #374151; /* bg-gray-700 */
    transition: all 0.3s ease;
}

.step-item.in-progress .step-icon {
    border-color: #3b82f6; /* border-blue-500 */
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa; /* text-blue-400 */
}

.step-item.completed .step-icon {
    border-color: #22c55e; /* border-green-500 */
    background-color: rgba(34, 197, 94, 0.2);
    color: #4ade80; /* text-green-400 */
}

.step-item.failed .step-icon {
    border-color: #ef4444; /* border-red-500 */
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171; /* text-red-400 */
}

.step-text {
    margin-left: 0.75rem; /* ml-3 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    color: #9ca3af; /* text-gray-400 */
    transition: color 0.3s ease;
}

.step-item.in-progress .step-text {
    color: #e5e7eb; /* text-gray-200 */
}
.step-item.completed .step-text, .step-item.failed .step-text {
    color: #f9fafb; /* text-gray-50 */
}

/* Light theme adjustments */
.light-theme #addNodeModal .modal-content {
    background: linear-gradient(145deg, #f9fafb, #f3f4f6);
    border-color: #e5e7eb;
}

.light-theme .step-icon {
    border-color: #d1d5db; /* border-gray-300 */
    background-color: #e5e7eb; /* bg-gray-200 */
}

.light-theme .step-item.in-progress .step-icon {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}
.light-theme .step-item.completed .step-icon {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}
.light-theme .step-item.failed .step-icon {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.light-theme .step-text { color: #6b7280; }
.light-theme .step-item.in-progress .step-text { color: #374151; }
.light-theme .step-item.completed .step-text, .light-theme .step-item.failed .step-text { color: #111827; }

/* === END: Modern Add Node Modal Styles === */





details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] .arrow-down { display: none; }
details:not([open]) .arrow-up { display: none; }

.light-mode .download-btn {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb) !important;
    color: #1f2937 !important; /* متن اصلی را تیره می‌کند */
}

.light-mode .download-btn span,
.light-mode .download-btn i,
.light-mode .download-btn strong {
    color: #1f2937 !important; /* متن داخل تگ‌ها را نیز تیره می‌کند */
}

.light-mode .download-btn .text-green-300 {
    color: #047857 !important; /* رنگ سبز "Default" را خواناتر می‌کند */
}

.light-mode details > summary {
    color: #1f2937 !important; /* رنگ متن تیتر را تیره می‌کند */
}

.light-mode details > summary i {
    color: #4f46e5 !important; /* رنگ آیکون کنار تیتر را تغییر می‌دهد */
}

/* START: Fix for light theme download section text color */
.light-mode details > summary > span,
.light-mode details > summary > span > i {
    color: #1f2937 !important; /* Dark color for summary text and icon */
}

.light-mode details > summary > span > .arrow-down,
.light-mode details > summary > span > .arrow-up {
    color: #1f2937 !important; /* Dark color for arrows */
}

.light-mode .download-btn {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb) !important;
    color: #1f2937 !important; /* Dark text for download links */
}

.light-mode .download-btn span,
.light-mode .download-btn i,
.light-mode .download-btn strong {
    color: #1f2937 !important; /* Dark text for all elements inside download links */
}

.light-mode .download-btn .text-green-300 {
    color: #047857 !important; /* Readable green for "Default" text */
}
/* END: Fix for light theme download section text color */


.light-mode .wr {color: #047857;}


details.bg-gray-800\/50 {
    border-color: rgba(55, 65, 81, 0.8) !important; /* A darker, more subtle border color for dark theme */
}

.light-mode details.bg-gray-800\/50 {
    border-color: rgba(55, 65, 81, 0.1) !important; /* A darker, more subtle border color for dark theme */
}

/* --- Professional Smart Download Modal Styles --- */
.smart-download-modal-content {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-out;
}

.download-group-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #cbd5e1; /* slate-300 */
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}

.download-group-details {
    background-color: rgba(17, 24, 39, 0.5); /* gray-900/50 */
    border-radius: 0.75rem;
    border: 1px solid rgba(55, 65, 81, 1); /* gray-700 */
    transition: all 0.3s ease;
	margin-bottom: 0.5rem;
}

.download-group-details[open] {
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-color: rgba(79, 70, 229, 0.5); /* indigo-600 */
}

.download-group-summary {
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: #e5e7eb; /* gray-200 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    border-radius: 0.75rem;
}

.download-group-details[open] > .download-group-summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.download-group-summary:hover {
    background-color: rgba(55, 65, 81, 0.5); /* gray-700/50 */
}

.download-group-summary > span {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.download-group-summary > span > i {
    color: #a5b4fc; /* indigo-300 */
}

.download-group-details[open] .details-arrow {
    transform: rotate(180deg);
}
.details-arrow {
    transition: transform 0.3s ease;
}

.download-group-content {
    padding: 0.75rem;
    border-top: 1px solid rgba(55, 65, 81, 1);
    space-y: 0.5rem;
}

.download-modal-link {
    background: rgba(55, 65, 81, 0.6);
    color: #d1d5db; /* gray-300 */
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
	margin-bottom: 0.5rem;
}

.download-modal-link:hover {
    background: #4f46e5; /* indigo-600 */
    color: #ffffff;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.download-modal-link > span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.default-badge {
    font-size: 0.7rem;
    background-color: rgba(16, 185, 129, 0.2); /* green-500/20 */
    color: #6ee7b7; /* green-300 */
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

/* Light Theme Overrides */
.light-theme .smart-download-modal-content {
    background: linear-gradient(145deg, #f9fafb, #f3f4f6);
    border-color: #e5e7eb;
}
.light-theme .smart-download-modal-content .border-white\/10 {
    border-color: #e5e7eb;
}
.light-theme .download-group-title {
    color: #374151; /* gray-700 */
}
.light-theme .download-group-details {
    background-color: #ffffff;
    border-color: #e5e7eb;
}
.light-theme .download-group-details[open] {
    border-color: #6366f1; /* indigo-500 */
}
.light-theme .download-group-summary {
    color: #1f2937; /* gray-800 */
}
.light-theme .download-group-summary:hover {
    background-color: #f3f4f6; /* gray-100 */
}
.light-theme .download-group-summary > span > i {
    color: #4f46e5; /* indigo-600 */
}
.light-theme .download-group-content {
    border-color: #e5e7eb;
}
.light-theme .download-modal-link {
    background-color: #eef2ff; /* indigo-50 */
    color: #4338ca; /* indigo-700 */
}
.light-theme .download-modal-link:hover {
    background: #4f46e5; /* indigo-600 */
    color: #ffffff;
}
.light-theme .default-badge {
    background-color: #dcfce7; /* green-100 */
    color: #15803d; /* green-700 */
}
.light-theme #smartDownloadModal button {
    border-color: #d1d5db; /* gray-300 */
}
.light-theme #smartDownloadModal button:hover {
    background-color: #e5e7eb; /* gray-200 */
}


#multiServerContainer {
    transition: all 0.4s ease-in-out;

}
.endpoint-group {
    background-color: rgba(17, 24, 39, 0.6);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}
.endpoint-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #9ca3af; /* gray-400 */
    margin-bottom: 0.5rem;
}
.endpoint-ports {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.server-option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #374151; /* gray-700 */
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #d1d5db; /* gray-300 */
    cursor: pointer;
    border: 1px solid #4b5563; /* gray-600 */
    transition: all 0.2s ease;
}
.server-option-item:hover {
    border-color: #6366f1; /* indigo-500 */
}
.server-option-item input[type="checkbox"] {
    display: none;
}
.server-option-item input:checked + i {
    color: #4ade80; /* green-400 */
}
.server-option-item input:checked + i + span {
    color: #ffffff;
}
/* Light Theme */
.light-theme .endpoint-group { background-color: #f3f4f6; }
.light-theme .endpoint-name { color: #6b7280; }
.light-theme .server-option-item {
    background-color: #e5e7eb; /* gray-200 */
    color: #374151; /* gray-700 */
    border-color: #d1d5db; /* gray-300 */
}
.light-theme .server-option-item:hover { border-color: #4f46e5; }
.light-theme .server-option-item input:checked + i + span { color: #1f2937; }

.multi-server-link {
    background: linear-gradient(135deg, #14b8a6, #0891b2) !important; /* teal to cyan */
    border: 1px solid rgba(45, 212, 191, 0.3);
}
.multi-server-link:hover {
    background: linear-gradient(135deg, #0f766e, #0e7490) !important;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.light-theme .multi-server-link {
    background: linear-gradient(135deg, #14b8a6, #0891b2) !important;
    color: #ffffff !important;
}
.light-theme .multi-server-link:hover {
    background: linear-gradient(135deg, #0f766e, #0e7490) !important;
}



/* START: FINAL RESPONSIVE & Vertical Tabs for Settings Modal v3 */

/* Main modal content area */
.settings-modal-content {
    background: #1e293b; /* slate-800 */
}

/* Vertical tabs for desktop (md screens and up) */
.tab-button {
    background-color: transparent;
    color: #94a3b8; /* slate-400 */
    transition: all 0.2s ease-in-out;
    border-left: 3px solid transparent;
}
.tab-button:hover {
    background-color: rgba(51, 65, 85, 0.5); /* slate-700/50 */
    color: #f1f5f9; /* slate-100 */
}
.tab-button.active {
    background-color: rgba(79, 70, 229, 0.1); /* indigo-600/10 */
    color: #c7d2fe; /* indigo-200 */
    font-weight: 600;
    border-left-color: #6366f1; /* indigo-500 */
}
.tab-button.active i {
    color: #818cf8; /* indigo-400 */
}

/* Horizontal capsule tabs for mobile (screens smaller than md) */
.tab-button-mobile {
    flex-grow: 1;
    padding: 0.5rem 0.5rem;
    font-size: 0.75rem; /* text-xs */
    font-weight: 500;
    color: #9ca3af; /* gray-400 */
    border-radius: 9999px; /* rounded-full */
    background-color: #374151; /* gray-700 */
    transition: all 0.2s ease-in-out;
    border: 1px solid #4b5563; /* gray-600 */
}
.tab-button-mobile.active {
    color: #ffffff;
    background-color: #4f46e5; /* indigo-600 */
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

/* === START: UNIFIED LIGHT THEME OVERRIDES === */

.light-theme .settings-modal-content {
    background-color: #ffffff; /* Main background is now white */
    border-color: #e5e7eb; /* light border */
}

.light-theme .border-gray-700 {
    border-color: #e5e7eb;
}

.light-theme .text-white {
    color: #111827; /* Dark text for readability */
}

.light-theme .bg-gray-900\/30 {
    background-color: #f9fafb; /* Off-white for the sidebar */
}

.light-theme .tab-content,
.light-theme .bg-gray-700,
.light-theme .bg-gray-700\/30,
.light-theme .bg-gray-700\/50 {
    background-color: #ffffff; /* All content backgrounds are white */
}

/* START: UNIFIED INPUT STYLES FOR LIGHT THEME (REPLACE OLD CODE WITH THIS) */
.light-theme input:not([type=checkbox]):not([type=radio]),
.light-theme select,
.light-theme textarea {
    background-color: #f9fafb !important; /* رنگ پس‌زمینه خاکستری روشن */
    color: #1f2937 !important;            /* رنگ متن تیره */
    border: 1px solid #d1d5db !important; /* ایجاد کادر ۱ پیکسلی خاکستری */
}
/* END: UNIFIED INPUT STYLES */

/* Vertical Tabs Light Theme */
.light-theme .tab-button {
    color: #4b5563;
}
.light-theme .tab-button:hover {
    background-color: #f3f4f6;
    color: #312e81;
}
.light-theme .tab-button.active {
    background-color: #eef2ff;
    color: #4338ca;
    border-left-color: #4f46e5;
}
.light-theme .tab-button.active i {
    color: #4f46e5;
}

/* Mobile Tabs Light Theme */
.light-theme .tab-button-mobile {
    color: #374151;
    background-color: #e5e7eb;
    border-color: #d1d5db;
}
.light-theme .tab-button-mobile.active {
    color: #ffffff;
    background-color: #4f46e5;
    border-color: transparent;
}
/* === END: UNIFIED LIGHT THEME OVERRIDES === */

/* END: FINAL RESPONSIVE SETTINGS MODAL v3 */








/* Styles for Multi-Server Tab UI Improvements v2 */
.server-group > summary, .endpoint-group > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    background-color: rgba(55, 65, 81, 0.6); /* gray-700/60 */
    transition: background-color 0.2s ease;
    user-select: none; /* Prevents text selection on click */
    list-style: none; /* Remove default marker */
}

/* Explicitly remove marker for Webkit */
.server-group > summary::-webkit-details-marker,
.endpoint-group > summary::-webkit-details-marker {
    display: none;
}

.server-group > summary:hover, .endpoint-group > summary:hover {
    background-color: rgba(75, 85, 99, 0.6); /* gray-600/60 */
}

.details-arrow {
    transition: transform 0.3s ease;
    color: #9ca3af; /* gray-400 */
}

.server-group[open] > summary .details-arrow,
.endpoint-group[open] > summary .details-arrow {
    transform: rotate(180deg);
}

.server-options {
    padding-left: 1rem;
    border-left: 2px solid #4b5563; /* gray-600 */
    margin-top: 0.5rem;
    margin-left: 0.5rem;
}

.endpoint-group {
    background-color: transparent;
    padding: 0;
    margin-top: 0.5rem;
}

.endpoint-ports {
    padding: 0.75rem;
    border-top: 1px solid #4b5563; /* gray-600 */
}

/* Light Theme */
.light-theme .server-group > summary, .light-theme .endpoint-group > summary {
    background-color: #f3f4f6; /* gray-100 */
}
.light-theme .server-group > summary:hover, .light-theme .endpoint-group > summary:hover {
    background-color: #e5e7eb; /* gray-200 */
}
.light-theme .server-options {
    border-left-color: #d1d5db; /* gray-300 */
}
.light-theme .endpoint-ports {
    border-top-color: #d1d5db; /* gray-300 */
}
.light-theme .details-arrow {
    color: #6b7280; /* gray-500 */
}







.server-group > summary, .endpoint-group > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    background-color: rgba(55, 65, 81, 0.6); /* gray-700/60 */
    transition: background-color 0.2s ease;
    user-select: none; /* Prevents text selection on click */
    list-style: none; /* Remove default marker */
}

/* Explicitly remove marker for Webkit */
.server-group > summary::-webkit-details-marker,
.endpoint-group > summary::-webkit-details-marker {
    display: none;
}

.server-group > summary:hover, .endpoint-group > summary:hover {
    background-color: rgba(75, 85, 99, 0.6); /* gray-600/60 */
}

.details-arrow {
    transition: transform 0.3s ease;
    color: #9ca3af; /* gray-400 */
}

.server-group[open] > summary .details-arrow,
.endpoint-group[open] > summary .details-arrow {
    transform: rotate(180deg);
}

.server-options {
    padding-left: 1rem;
    border-left: 2px solid #4b5563; /* gray-600 */
    margin-top: 0.5rem;
    margin-left: 0.5rem;
}

.endpoint-group {
    background-color: transparent;
    padding: 0;
    margin-top: 0.5rem;
}

.endpoint-ports {
    padding: 0.75rem;
    border-top: 1px solid #4b5563; /* gray-600 */
}

/* Light Theme */
.light-theme .server-group > summary, .light-theme .endpoint-group > summary {
    background-color: #f3f4f6; /* gray-100 */
}
.light-theme .server-group > summary:hover, .light-theme .endpoint-group > summary:hover {
    background-color: #e5e7eb; /* gray-200 */
}
.light-theme .server-options {
    border-left-color: #d1d5db; /* gray-300 */
}
.light-theme .endpoint-ports {
    border-top-color: #d1d5db; /* gray-300 */
}
.light-theme .details-arrow {
    color: #6b7280; /* gray-500 */
}




/* ✂️ COPY-PASTE (این کد را به انتهای فایل style.css اضافه کنید) */

/* Server Selection Cards for Ports Tab */
.port-server-selector-label {
    position: relative;
    display: block;
    cursor: pointer;
}

.server-select-card {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* gap-3 */
    padding: 0.75rem; /* p-3 */
    border: 2px solid #4b5563; /* border-gray-600 */
    border-radius: 0.5rem; /* rounded-lg */
    background-color: rgba(55, 65, 81, 0.4); /* bg-gray-700/40 */
    transition: all 0.2s ease-in-out;
}

.port-server-selector-label:hover .server-select-card {
    border-color: #6b7280; /* border-gray-500 */
    background-color: rgba(55, 65, 81, 0.7);
}

.port-server-selector-label input[type="checkbox"] {
    display: none; /* Hide the actual checkbox */
}

/* Style for when the checkbox is checked */
.port-server-selector-label input:checked + .server-select-card {
    border-color: #4f46e5; /* border-indigo-600 */
    background-color: rgba(79, 70, 229, 0.15); /* bg-indigo-600/15 */
    box-shadow: 0 0 0 1px #4f46e5;
}

.server-select-card .icon {
    color: #9ca3af; /* text-gray-400 */
    transition: color 0.2s ease-in-out;
}

.port-server-selector-label input:checked + .server-select-card .icon {
    color: #818cf8; /* text-indigo-400 */
}

.server-select-card .name {
    font-weight: 500; /* font-medium */
    color: #d1d5db; /* text-gray-300 */
    transition: color 0.2s ease-in-out;
}

.port-server-selector-label input:checked + .server-select-card .name {
    color: #e5e7eb; /* text-gray-200 */
}

/* Light Theme */
.light-theme .server-select-card {
    border-color: #d1d5db;
    background-color: #f9fafb;
}
.light-theme .port-server-selector-label:hover .server-select-card {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}
.light-theme .port-server-selector-label input:checked + .server-select-card {
    border-color: #4338ca;
    background-color: #eef2ff;
}
.light-theme .server-select-card .icon {
    color: #6b7280;
}
.light-theme .port-server-selector-label input:checked + .server-select-card .icon {
    color: #4f46e5;
}
.light-theme .server-select-card .name {
    color: #374151;
}
.light-theme .port-server-selector-label input:checked + .server-select-card .name {
    color: #111827;
}


/* General Server Selection Card Styles */
.server-select-label {
    position: relative;
    display: block;
    cursor: pointer;
}

.server-select-card {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* gap-3 */
    padding: 0.75rem; /* p-3 */
    border: 2px solid #4b5563; /* border-gray-600 */
    border-radius: 0.5rem; /* rounded-lg */
    background-color: rgba(55, 65, 81, 0.4); /* bg-gray-700/40 */
    transition: all 0.2s ease-in-out;
}

.server-select-label:hover .server-select-card {
    border-color: #6b7280; /* border-gray-500 */
    background-color: rgba(55, 65, 81, 0.7);
}

.server-select-label input[type="checkbox"] {
    display: none; /* Hide the actual checkbox */
}

/* Style for when the checkbox is checked */
.server-select-label input:checked + .server-select-card {
    border-color: #4f46e5; /* border-indigo-600 */
    background-color: rgba(79, 70, 229, 0.15); /* bg-indigo-600/15 */
    box-shadow: 0 0 0 1px #4f46e5;
}

.server-select-card .icon {
    color: #9ca3af; /* text-gray-400 */
    transition: color 0.2s ease-in-out;
    width: 20px; /* Ensure consistent icon width */
    text-align: center;
}

.server-select-label input:checked + .server-select-card .icon {
    color: #818cf8; /* text-indigo-400 */
}

.server-select-card .name {
    font-weight: 500; /* font-medium */
    color: #d1d5db; /* text-gray-300 */
    transition: color 0.2s ease-in-out;
}

.server-select-label input:checked + .server-select-card .name {
    color: #e5e7eb; /* text-gray-200 */
}

/* Light Theme */
.light-theme .server-select-card {
    border-color: #d1d5db;
    background-color: #f9fafb;
}
.light-theme .server-select-label:hover .server-select-card {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}
.light-theme .server-select-label input:checked + .server-select-card {
    border-color: #4338ca;
    background-color: #eef2ff;
}
.light-theme .server-select-card .icon {
    color: #6b7280;
}
.light-theme .server-select-label input:checked + .server-select-card .icon {
    color: #4f46e5;
}
.light-theme .server-select-card .name {
    color: #374151;
}
.light-theme .server-select-label input:checked + .server-select-card .name {
    color: #111827;
}




.light-theme #apiKeyList > div,
.light-theme #subAdminApiKeyList > div {
    background-color: #f3f4f6; /* bg-gray-100 */
    border-color: #e5e7eb; /* border-gray-200 */
}

.light-theme #apiKeyList .font-semibold.text-white,
.light-theme #subAdminApiKeyList .font-semibold.text-white {
    color: #1f2937; /* text-gray-800 */
}

.light-theme #apiKeyList .text-xs.text-gray-400,
.light-theme #subAdminApiKeyList .text-xs.text-gray-400 {
    color: #6b7280; /* text-gray-500 */
}

.light-theme #apiKeyList .bg-gray-900\/50,
.light-theme #subAdminApiKeyList .bg-gray-900\/50 {
    background-color: #e5e7eb; /* bg-gray-200 */
}

.light-theme #apiKeyList .text-indigo-300,
.light-theme #subAdminApiKeyList .text-indigo-300 {
    color: #4338ca; /* text-indigo-700 */
}


.light-theme .filter-card-label:hover .filter-text {
    color: #1f2937; /* A dark, readable text color like text-gray-800 */
}


.light-theme .filter-card-label {
    border-color: #d1d5db; /* A light gray color (border-gray-300) */
}


/* Ensure selected border colors are applied correctly in light theme */
.light-theme .filter-card-label.border-blue-500 {
    border-color: #3b82f6 !important; /* blue-500 */
}
.light-theme .filter-card-label.border-orange-500 {
    border-color: #f97316 !important; /* orange-500 */
}
.light-theme .filter-card-label.border-red-500 {
    border-color: #ef4444 !important; /* red-500 */
}
.light-theme .filter-card-label.border-green-500 {
    border-color: #22c55e !important; /* green-500 */
}


.filter-card-label.border-blue-500 {
    border-color: #3b82f6; /* A vibrant blue */
}
.filter-card-label.border-orange-500 {
    border-color: #f97316; /* A vibrant orange */
}
.filter-card-label.border-red-500 {
    border-color: #ef4444; /* A vibrant red */
}
.filter-card-label.border-green-500 {
    border-color: #22c55e; /* A vibrant green */
}

.filter-card-label:has(input[value="data_limited"]) .filter-icon {
    color: #f97316; /* A vibrant orange, matching the border */
}


.bg-gradient-to-r.from-teal-500.to-cyan-500 {
    background: linear-gradient(135deg, #14b8a6, #06b6d4);
    border: none;
    color: white;
}
.bg-gradient-to-r.from-teal-500.to-cyan-500:hover {
    background: linear-gradient(135deg, #0d9488, #0891b2);
}
.light-theme .bg-gradient-to-r.from-teal-500.to-cyan-500 {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #1a1a1a;
}

.bulk-action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: rgba(55, 65, 81, 0.4); /* bg-gray-700/40 */
    border: 1px solid #4b5563; /* border-gray-600 */
    border-radius: 0.75rem; /* rounded-xl */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.bulk-action-card:hover {
    border-color: #6366f1; /* border-indigo-500 */
    background-color: rgba(55, 65, 81, 0.7);
    transform: translateY(-2px);
}

.bulk-action-icon {
    flex-shrink: 0;
    width: 3rem; /* w-12 */
    height: 3rem; /* h-12 */
    border-radius: 9999px; /* rounded-full */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem; /* text-xl */
}

/* Light Theme overrides */
.light-theme .bulk-action-card {
    background-color: #f9fafb; /* bg-gray-50 */
    border-color: #e5e7eb; /* border-gray-200 */
}

.light-theme .bulk-action-card:hover {
    border-color: #4f46e5; /* border-indigo-600 */
    background-color: #ffffff;
}

.light-theme .bulk-action-card h4 {
    color: #1f2937; /* text-gray-800 */
}

.light-theme .bulk-action-card p {
    color: #6b7280; /* text-gray-500 */
}

.light-theme #bulkActionConfirmModal {
    border-color: #dc2626; /* border-red-600 */
}
.light-theme .bg-gradient-to-r.from-green-500.to-green-500 {
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    color: #1a1a1a;
}


/* Server Selection Cards for Ports Tab */
.port-server-selector-label {
    position: relative;
    display: block;
    cursor: pointer;
}

.server-select-card {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* gap-3 */
    padding: 0.75rem; /* p-3 */
    border: 2px solid #4b5563; /* border-gray-600 */
    border-radius: 0.5rem; /* rounded-lg */
    background-color: rgba(55, 65, 81, 0.4); /* bg-gray-700/40 */
    transition: all 0.2s ease-in-out;
}

.port-server-selector-label:hover .server-select-card {
    border-color: #6b7280; /* border-gray-500 */
    background-color: rgba(55, 65, 81, 0.7);
}

.port-server-selector-label input[type="checkbox"] {
    display: none; /* Hide the actual checkbox */
}

/* Style for when the checkbox is checked */
.port-server-selector-label input:checked + .server-select-card {
    border-color: #4f46e5; /* border-indigo-600 */
    background-color: rgba(79, 70, 229, 0.15); /* bg-indigo-600/15 */
    box-shadow: 0 0 0 1px #4f46e5;
}

.server-select-card .icon {
    color: #9ca3af; /* text-gray-400 */
    transition: color 0.2s ease-in-out;
}

.port-server-selector-label input:checked + .server-select-card .icon {
    color: #818cf8; /* text-indigo-400 */
}

.server-select-card .name {
    font-weight: 500; /* font-medium */
    color: #d1d5db; /* text-gray-300 */
    transition: color 0.2s ease-in-out;
}

.port-server-selector-label input:checked + .server-select-card .name {
    color: #e5e7eb; /* text-gray-200 */
}

/* Light Theme */
.light-theme .server-select-card {
    border-color: #d1d5db;
    background-color: #f9fafb;
}
.light-theme .port-server-selector-label:hover .server-select-card {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}
.light-theme .port-server-selector-label input:checked + .server-select-card {
    border-color: #4338ca;
    background-color: #eef2ff;
}
.light-theme .server-select-card .icon {
    color: #6b7280;
}
.light-theme .port-server-selector-label input:checked + .server-select-card .icon {
    color: #4f46e5;
}
.light-theme .server-select-card .name {
    color: #374151;
}
.light-theme .port-server-selector-label input:checked + .server-select-card .name {
    color: #111827;
}




/* Cheater Glow for User Subscription Page */
.cheater-glow {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5), inset 0 0 15px rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.4) !important;
}
.light-theme .cheater-glow {
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.4), inset 0 0 15px rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.4) !important;
}

/* Red Background for Connection Badge in Dashboard */
.bg-gradient-to-r.from-red-cheater.to-pink-cheater {
    background: linear-gradient(135deg, #b91c1c, #be185d);
}
.light-theme .bg-gradient-to-r.from-red-cheater.to-pink-cheater {
    background: linear-gradient(135deg, #fee2e2, #fecdd3);
    color: #991b1b !important;
}
.light-theme .bg-gradient-to-r.from-red-cheater.to-pink-cheater .text-white {
     color: #991b1b !important;
}



/* ======================================================= */
/* START: NEW STYLES FOR COMPACT & STYLISH NODE CARDS V2   */
/* ======================================================= */

.node-card-compact {
    background: rgba(30, 41, 59, 0.6); /* slate-800 with transparency */
    border: 1px solid rgba(75, 85, 99, 0.7); /* gray-600 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(3px);
}

.node-card-compact:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: #4f46e5; /* indigo-600 */
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.25);
}

.node-card-compact-icon {
    flex-shrink: 0;
    width: 3rem;  /* w-12 */
    height: 3rem; /* h-12 */
    border-radius: 0.75rem; /* rounded-xl */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem; /* text-2xl */
    background-color: rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

.group:hover .node-card-compact-icon {
    transform: rotate(-10deg);
}

.node-stat-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: #cbd5e1; /* slate-300 */
}

.node-stat-item i {
    width: 1.1rem; /* for alignment */
    text-align: center;
    opacity: 0.8;
}

.node-stat-item .stat-value {
    margin-left: auto;
    font-weight: 600;
    font-family: monospace;
    color: #f1f5f9; /* slate-100 */
    background-color: rgba(15, 23, 42, 0.5); /* slate-900/50 */
    padding: 0.1rem 0.5rem;
    border-radius: 0.375rem; /* rounded-md */
    border: 1px solid rgba(75, 85, 99, 0.5);
}

.node-actions-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.node-action-btn-compact {
    padding: 0.6rem; /* کاهش فاصله داخلی برای فشردگی بیشتر */
    border-radius: 0.5rem;
    font-size: 0.8rem; /* کوچک‌تر کردن اندازه آیکون */
    background-color: rgba(75, 85, 99, 0.3);
    color: #9ca3af;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.node-action-btn-compact:hover {
    background-color: #4f46e5;
    color: #ffffff;
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Light Theme Adjustments */
.light-theme .node-card-compact {
    background: #ffffff;
    border-color: #e5e7eb; /* gray-200 */
}
.light-theme .node-card-compact:hover {
    border-color: #4338ca; /* indigo-700 */
}
.light-theme .node-card-compact-icon {
    background-color: #f3f4f6; /* gray-100 */
}
.light-theme .node-stat-item {
    color: #4b5563; /* gray-600 */
}
.light-theme .node-stat-item .stat-value {
    color: #111827; /* gray-900 */
    background-color: #eef2ff; /* indigo-50 */
    border-color: #d1d5db; /* gray-300 */
}
.light-theme .node-action-btn-compact {
    background-color: #e5e7eb; /* gray-200 */
    color: #4b5563; /* gray-600 */
}
.light-theme .node-action-btn-compact:hover {
    background-color: #4f46e5;
    color: #ffffff;
    border-color: transparent;
}




/* ======================================================= */
/* END: NEW STYLES                                         */
/* ======================================================= */


/* ======================================================= */
/* START: NEW STYLES FOR DEBUG & FIX MODAL LOG             */
/* ======================================================= */

#debugLogContainer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* space-y-3 */
}

.debug-log-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border-left-width: 4px;
    animation: fadeIn 0.3s ease-out;
}

.debug-log-entry .icon {
    margin-top: 0.2rem;
}

.debug-log-entry.info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #93c5fd;
}
.debug-log-entry.info .icon { color: #60a5fa; }

.debug-log-entry.success {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #86efac;
}
.debug-log-entry.success .icon { color: #4ade80; }

.debug-log-entry.warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #fcd34d;
}
.debug-log-entry.warning .icon { color: #fbbf24; }

.debug-log-entry.error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #fca5a5;
}
.debug-log-entry.error .icon { color: #f87171; }

.debug-log-entry.final {
    background-color: rgba(20, 184, 166, 0.1);
    border-color: #14b8a6;
    color: #5eead4;
    font-weight: 600;
}
.debug-log-entry.final .icon { color: #2dd4bf; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Light theme overrides */
.light-theme .debug-log-entry.info { background-color: #eef2ff; color: #3730a3; border-color: #6366f1; }
.light-theme .debug-log-entry.success { background-color: #f0fdf4; color: #15803d; border-color: #22c55e; }
.light-theme .debug-log-entry.warning { background-color: #fffbeb; color: #b45309; border-color: #f59e0b; }
.light-theme .debug-log-entry.error { background-color: #fef2f2; color: #b91c1c; border-color: #ef4444; }
.light-theme .debug-log-entry.final { background-color: #f0fdfa; color: #0f766e; border-color: #14b8a6; }

/* ======================================================= */
/* END: NEW STYLES                                         */
/* ======================================================= */


.user-status-controls.processing .slider {
    background-color: #6b7280; /* A neutral gray color like gray-500 */
    cursor: wait;
}

.user-status-controls.processing {
    opacity: 0.7;
    pointer-events: none; /* Prevent multiple clicks while processing */
}

/* Light theme adjustments */
.light-theme .user-status-controls.processing .slider {
    background-color: #d1d5db; /* A light gray for light theme */
}


.user-status-controls.processing .slider {
    background-color: #6b7280; /* A neutral gray color like gray-500 */
    cursor: wait;
}

.user-status-controls.processing {
    opacity: 0.7;
    pointer-events: none; /* Prevent multiple clicks while processing */
}

/* Light theme adjustments */
.light-theme .user-status-controls.processing .slider {
    background-color: #d1d5db; /* A light gray for light theme */
}



.zip-icon-btn {
    background-color: rgba(245, 158, 11, 0.2); /* bg-amber-500/20 */
    color: #fcd34d; /* text-amber-300 */
    padding: 0.5rem 0.6rem;
    border-radius: 0.375rem; /* rounded-md */
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.zip-icon-btn:hover {
    background-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24; /* text-amber-400 */
    transform: scale(1.05);
}

/* حالت در حال پردازش (لودینگ) */
.zip-icon-btn.processing {
    color: #9ca3af; /* text-gray-400 */
    background-color: rgba(75, 85, 99, 0.3);
    border-color: rgba(107, 114, 128, 0.5);
    pointer-events: none; /* جلوگیری از کلیک‌های مکرر */
}

/* حالت موفقیت (کپی شد) */
.zip-icon-btn.success {
    background-color: rgba(34, 197, 94, 0.2);
    color: #86efac; /* text-green-300 */
    border-color: rgba(34, 197, 94, 0.4);
}

/* Light Theme */
.light-mode .zip-icon-btn {
    background-color: #fffbeb; /* amber-50 */
    color: #d97706; /* amber-600 */
    border-color: #fcd34d; /* amber-300 */
}
.light-mode .zip-icon-btn:hover {
    background-color: #fef3c7; /* amber-100 */
    color: #b45309; /* amber-700 */
}
.light-mode .zip-icon-btn.processing {
    background-color: #f3f4f6; /* gray-100 */
    color: #6b7280; /* gray-500 */
    border-color: #d1d5db; /* gray-300 */
}
.light-mode .zip-icon-btn.success {
    background-color: #f0fdf4; /* green-50 */
    color: #16a34a; /* green-600 */
    border-color: #86efac; /* green-300 */
}

.sortable-ghost {
    opacity: 0.4;
    background-color: #4f46e5; /* رنگ آبی/بنفش پنل */
    border-radius: 1rem;
}

/* تغییر نشانگر موس برای نشان دادن قابلیت جابجایی */
.node-card-compact {
    cursor: grab; /* آیکون "گرفتن" */
}

/* تغییر نشانگر موس هنگام نگه داشتن کلیک */
.node-card-compact:active {
    cursor: grabbing; /* آیکون "در حال گرفتن" */
}


.filename-formatter {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 768px) {
    .filename-formatter {
        grid-template-columns: 2fr 1fr; /* دو ستون در دسکتاپ */
    }
}

/* ستون سمت راست (تگ‌های موجود) */
.filename-tags-available {
    background-color: rgba(17, 24, 39, 0.7); /* bg-gray-900/70 */
    border: 1px solid #4b5563; /* border-gray-600 */
    border-radius: 0.5rem;
    padding: 0.75rem;
    height: 100%;
}
.filename-tags-available-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 50px;
}
.light-theme .filename-tags-available {
    background-color: #f3f4f6; /* bg-gray-100 */
    border-color: #d1d5db; /* border-gray-300 */
}

/* ستون سمت چپ (فرمول شما) */
.filename-formula-builder {
    background-color: rgba(17, 24, 39, 0.7);
    border: 1px dashed #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 50px;
}
.light-theme .filename-formula-builder {
    background-color: #f9fafb; /* bg-gray-50 */
    border-color: #9ca3af; /* border-gray-400 */
}

/* استایل تگ‌ها */
.filename-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}
.filename-tag.tag-item { /* تگ‌های داینامیک */
    background-color: #3b82f6; /* bg-blue-600 */
    color: white;
}
.filename-tag.static-item { /* تگ‌های متن ثابت */
    background-color: #374151; /* bg-gray-700 */
    color: #d1d5db; /* text-gray-300 */
}
.filename-tag.static-item input { /* اینپوت متن ثابت */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    width: 60px; /* عرض پیش‌فرض */
    outline: none;
}
.filename-tag.static-item input:focus {
    outline: 1px dashed #6b7280;
}
.light-theme .filename-tag.tag-item {
    background-color: #2563eb; /* bg-blue-600 */
}
.light-theme .filename-tag.static-item {
    background-color: #e5e7eb; /* bg-gray-200 */
    color: #1f2937; /* text-gray-800 */
}
.light-theme .filename-tag.static-item input:focus {
    outline: 1px dashed #4b5563;
}

/* دکمه حذف تگ */
.tag-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tag-delete-btn:hover {
    color: white;
}
.light-theme .tag-delete-btn {
    color: #6b7280;
}
.light-theme .tag-delete-btn:hover {
    color: #111827;
}

/* پیش‌نمایش نام فایل */
.filename-preview {
    background-color: rgba(17, 24, 39, 0.7);
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-family: monospace;
    font-size: 0.875rem;
    color: #9ca3af; /* text-gray-400 */
    word-break: break-all;
}
.filename-preview .preview-base {
    color: #e5e7eb; /* text-gray-200 */
}
.light-theme .filename-preview {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}
.light-theme .filename-preview .preview-base {
    color: #1f2937;
}






/* Collapsible "Add" Form Section */
.port-section-details {
    background-color: rgba(30, 41, 59, 0.6); /* slate-800/60 */
    border: 1px solid #4b5563; /* gray-600 */
    border-radius: 0.75rem; /* rounded-xl */
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}
.port-section-details[open] {
    background-color: rgba(30, 41, 59, 0.9);
    border-color: #3b82f6; /* blue-500 */
}
.port-section-summary {
    padding: 0.75rem 1.25rem;
    font-size: 1rem; /* 1.1rem بود */
    font-weight: 600;
    color: #e5e7eb; /* gray-200 */
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.port-section-summary::-webkit-details-marker { display: none; }
.port-section-summary .details-arrow { transition: transform 0.3s ease; }
.port-section-details[open] .details-arrow { transform: rotate(180deg); }

.port-section-content {
    padding: 1.25rem;
    border-top: 1px solid #4b5563;
}

/* Card for Custom Ports List */
.port-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #4b5563;
    padding: 0.75rem 1rem; /* 1rem بود */
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}
.port-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}
.port-card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.port-card-info .icon {
    font-size: 1.25rem; /* 1.5rem بود */
    color: #93c5fd; /* blue-300 */
}
.port-card-info .port-text {
    font-size: 0.875rem; /* 1.0rem بود */
    font-weight: 600;
    color: #ffffff;
}
.port-card-info .server-text {
    font-size: 0.7rem; /* 0.75rem بود */
    color: #9ca3af; /* gray-400 */
    font-family: monospace;
}

/* Card for Default Ports List */
.default-port-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(17, 24, 39, 0.5); /* gray-900/50 */
    border: 1px solid #374151; /* gray-700 */
    padding: 0.6rem 1rem; /* 0.75rem بود */
    border-radius: 0.75rem;
}
.default-port-card-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.default-port-card-info .icon {
    color: #a5b4fc; /* indigo-300 */
    font-size: 1.125rem; /* اضافه شد */
}
.default-port-card-info .server-name {
    font-weight: 500;
    font-size: 0.875rem; /* text-sm */
    color: #e5e7eb; /* gray-200 */
}
.default-port-card-info .port-text {
    font-size: 0.7rem; /* 0.75rem بود */
    font-family: monospace;
    color: #9ca3af;
}

.port-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* 0.75rem بود */
}
.port-actions .action-btn {
    background: rgba(75, 85, 99, 0.3);
    color: #9ca3af;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    width: 2rem; /* 2.25rem بود */
    height: 2rem; /* 2.25rem بود */
    font-size: 0.875rem; /* اضافه شد */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.port-actions .action-btn:hover {
    color: #ffffff;
    background: #4f46e5;
    border-color: #4f46e5;
}
.port-actions .action-btn.delete:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Light Theme */
.light-theme .port-section-details {
    background-color: #f9fafb;
    border-color: #e5e7eb;
}
.light-theme .port-section-details[open] {
    background-color: #ffffff;
    border-color: #4f46e5;
}
.light-theme .port-section-summary { color: #1f2937; }
.light-theme .port-section-content { border-top-color: #e5e7eb; }

.light-theme .port-card {
    background: #ffffff;
    border-color: #e5e7eb;
}
.light-theme .port-card:hover { border-color: #4f46e5; }
.light-theme .port-card-info .icon { color: #3b82f6; }
.light-theme .port-card-info .port-text { color: #111827; }
.light-theme .port-card-info .server-text { color: #4b5563; }

.light-theme .default-port-card {
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.light-theme .default-port-card-info .icon { color: #4f46e5; }
.light-theme .default-port-card-info .server-name { color: #1f2937; }
.light-theme .default-port-card-info .port-text { color: #4b5563; }

.light-theme .port-actions .action-btn {
    background: #e5e7eb;
    color: #4b5563;
    border-color: #d1d5db;
}
.light-theme .port-actions .action-btn:hover {
    color: #ffffff;
    background: #4f46e5;
    border-color: #4f46e5;
}
.light-theme .port-actions .action-btn.delete:hover {
    background: #dc2626;
    border-color: #dc2626;
}




.flash-success {
    animation: flash-green 1.5s ease-out;
}
@keyframes flash-green {
    0% { background-color: #10b981; box-shadow: 0 0 15px #10b981; }
 
    100% { 
        background-color: transparent; 
        box-shadow: none;
    }
}




.method-selector input:checked + .method-card {
    border-color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.2) !important;
    box-shadow: 0 0 0 1px #3b82f6;
}

.method-selector input[value="direct_tcp"]:checked + .method-card {
    border-color: #22c55e !important;
    background-color: rgba(34, 197, 94, 0.2) !important;
    box-shadow: 0 0 0 1px #22c55e;
}


/* ========================================== */
/* ULTRA MODERN SSL MANAGER UI (Compact V4)   */
/* ========================================== */

.ssl-pro-wrapper {
    background: rgba(30, 41, 59, 0.7); /* Dark slate with transparency */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Header Styling */
.ssl-pro-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.9) 100%);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Status Pill */
.ssl-status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}
.status-dot.active { background-color: #10b981; color: #10b981; }
.status-dot.inactive { background-color: #ef4444; color: #ef4444; }
.status-dot.processing { background-color: #f59e0b; color: #f59e0b; animation: pulse 1s infinite; }

.status-text {
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #e2e8f0;
    letter-spacing: 0.5px;
}

/* Domain List Items */
.ssl-domain-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.ssl-domain-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

/* Inputs & Selects */
.ssl-pro-input, .ssl-pro-select {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.5);
    color: #f8fafc;
    padding: 0.5rem 0.75rem 0.5rem 2.2rem; /* Space for icon */
    border-radius: 0.5rem;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.ssl-pro-input:focus, .ssl-pro-select:focus {
    border-color: #6366f1; /* Indigo */
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    outline: none;
}

/* Buttons */
.btn-ssl-add {
    width: 100%;
    background: rgba(59, 130, 246, 0.15); /* Blue tint */
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-ssl-add:hover {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
}

.btn-ssl-primary {
    width: 100%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%); /* Emerald Gradient */
    color: white;
    padding: 0.65rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-ssl-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn-ssl-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}
.btn-ssl-primary:hover::after {
    left: 100%;
}


/* Badges */
.ssl-role-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.badge-main { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-sub { background: rgba(236, 72, 153, 0.15); color: #f9a8d4; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-reseller { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Light Theme Overrides */
.light-theme .ssl-pro-wrapper {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.light-theme .ssl-pro-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}
.light-theme .ssl-pro-header h3 { color: #1e293b; }
.light-theme .ssl-status-pill {
    background: #ffffff;
    border-color: #cbd5e1;
}
.light-theme .status-text { color: #475569; }
.light-theme .ssl-domain-card {
    background: #f8fafc;
    border-color: #f1f5f9;
}
.light-theme .ssl-domain-card:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}
.light-theme .ssl-domain-card .font-mono { color: #334155; }
.light-theme .ssl-pro-input, .light-theme .ssl-pro-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}
.light-theme .bg-gray-800\/30 {
    background-color: #f8fafc; /* Sidebar bg in light mode */
}