/* ===== XMPLUS PANELS GRID ===== */

.xmplus-panels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.xmplus-panel-card {
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.xmplus-panel-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.3);
}

.xmplus-panel-card.inactive {
    opacity: 0.7;
}

.panel-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1) 0%, rgba(0, 102, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.panel-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
}

.panel-status i {
    font-size: 0.8rem;
}

.panel-card-body {
    padding: 1.5rem;
}

.panel-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.9rem;
}

.panel-info-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.panel-info-item span {
    color: var(--text-secondary);
    word-break: break-all;
}

.panel-card-actions {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== XMPLUS SERVERS GRID ===== */

.xmplus-servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.xmplus-server-card {
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.xmplus-server-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.3);
}

.xmplus-server-card.configured {
    border-color: rgba(76, 175, 80, 0.3);
}

.xmplus-server-card.configured:hover {
    border-color: var(--success-color);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3);
}

.server-card-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1) 0%, rgba(0, 102, 255, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xmplus-server-card.configured .server-card-header {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.05) 100%);
}

.server-card-header h4 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.server-status {
    display: flex;
    gap: 0.5rem;
}

.server-status .badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-success {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-secondary {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

.server-card-body {
    padding: 1.5rem;
}

.server-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.server-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    min-height: 70px;
}

.server-info-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.server-info-item .value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.server-config-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.server-card-actions {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== FORM SECTIONS ===== */

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section h4 {
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h4 i {
    color: var(--primary-color);
}

.form-group label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 0;
}

.form-group label.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-group label.checkbox-label span {
    font-weight: 500;
    color: var(--text-primary);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== DEPLOY MODAL FIXES ===== */

/* Fix scrollbar positioning in Linode Accounts section */
.modal-content > form > div[style*="max-height: 200px"],
.modal-body > form > div[style*="max-height: 200px"] {
    padding-right: 0 !important;
    margin-right: 0 !important;
}

/* Fix checkbox alignment in deploy modal */
#deploy-server-form label[style*="display: flex"],
#edit-custom-server-form label[style*="display: flex"],
#add-custom-server-form label[style*="display: flex"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#deploy-server-form label[style*="display: flex"] input[type="checkbox"],
#edit-custom-server-form label[style*="display: flex"] input[type="checkbox"],
#add-custom-server-form label[style*="display: flex"] input[type="checkbox"] {
    margin-left: 0 !important;
    margin-right: 0.75rem !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

#deploy-server-form label[style*="display: flex"] span,
#edit-custom-server-form label[style*="display: flex"] span,
#add-custom-server-form label[style*="display: flex"] span {
    margin-left: 0.25rem !important;
    display: flex;
    align-items: center;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .xmplus-panels-grid,
    .xmplus-servers-grid {
        grid-template-columns: 1fr;
    }

    .server-info-grid {
        grid-template-columns: 1fr;
    }

    .panel-card-actions,
    .server-card-actions {
        flex-direction: column;
    }

    .panel-card-actions .btn,
    .server-card-actions .btn {
        width: 100%;
    }
}

/* ===== SERVER MANAGEMENT ===== */

.server-management {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.management-section {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.management-section h4 {
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.management-section h4 i {
    color: var(--primary-color);
}

.management-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.management-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* ===== ANIMATIONS ===== */

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

.xmplus-panel-card,
.xmplus-server-card {
    animation: fadeIn 0.3s ease forwards;
}

.xmplus-panel-card:nth-child(1),
.xmplus-server-card:nth-child(1) { animation-delay: 0s; }
.xmplus-panel-card:nth-child(2),
.xmplus-server-card:nth-child(2) { animation-delay: 0.05s; }
.xmplus-panel-card:nth-child(3),
.xmplus-server-card:nth-child(3) { animation-delay: 0.1s; }
.xmplus-panel-card:nth-child(4),
.xmplus-server-card:nth-child(4) { animation-delay: 0.15s; }
.xmplus-panel-card:nth-child(5),
.xmplus-server-card:nth-child(5) { animation-delay: 0.2s; }
.xmplus-panel-card:nth-child(6),
.xmplus-server-card:nth-child(6) { animation-delay: 0.25s; }
